Skip to content

Fix <unimplemented> for size_t return type on builtins#311

Open
davispuh wants to merge 1 commit into
jacob-carlborg:masterfrom
davispuh:sizet
Open

Fix <unimplemented> for size_t return type on builtins#311
davispuh wants to merge 1 commit into
jacob-carlborg:masterfrom
davispuh:sizet

Conversation

@davispuh

Copy link
Copy Markdown

Currently if you have code like this:

#include  <stdio.h>

size_t strlen(const char *__s);
size_t fread();

It's translated to:

extern (C):

<unimplemented> strlen (const(char)* __s);
<unimplemented> fread ();

Which obviously is invalid code.
This PR fixes this to create correct D code.

Note that this issue happens only with compiler's builtin functions that return size_t because clang merges it to internal unexposed type.

When a builtin function (e.g. fread, strlen) is redeclared with
size_t return type, clang merges compiler internal __size_t with
the size_t into an unexposed type with no valid declaration.
Copilot AI review requested due to automatic review settings June 30, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants