It looks like GCC recently moved from 'char *' to 'void *'.
This SO question[1] (4 years ago) quotes the GCC docs
and they had 'char *'.
Maybe Clang hasn't noticed the change.
I'll report a bug.
It looks like GCC recently moved from 'char *' to 'void *'.
This SO question[1] (4 years ago) quotes the GCC docs
and they had 'char *'.
__builtin___clear_cache in GCC has always been declared to take
void*. The signature in the manual was recently corrected to match
the implementation, i.e., from char* to void*, in r269082.
Thanks for the correction!
Then the prototypes that changes from 'char *' to 'void *' in r269082
were not exposed to the user, right?
I guess then those are just internal implementation where GCC did use
'char *'.
Where is the actual prototype exposed to the user declared?
I sent you an email, but I received a "delivery failure".
If you're reading this from a list, could you answer, please?
Thanks,
Alex
Hello Martin,
Thanks for the correction!
Then the prototypes that changes from 'char *' to 'void *' in r269082
were not exposed to the user, right?
I guess then those are just internal implementation where GCC did use
'char *'.
__builtin___clear_cache was added to GCC in r126535 (the __builtin_
prefix is added by the macro):
The BT_FN_VOID_PTR_PTR macro describes its signature as returning
void and taking two void pointer arguments. AFAIK, this has never
changed. Contrary to that, the manual entry for the built-in added
in the same revision documented it as taking two char*. That was
corrected to void* in r269082 to match.
There's a GCC internal declaration of __clear_cache (apparently
provided in libgcc for VxWorks). It was added in r264479 and
it also used char*. This was also changed to void* in r269082
to match the built-in. Looks like this __clear_cache has just
been removed from libgcc in GCC 11: https://gcc.gnu.org/pipermail/gcc-cvs/2020-December/338478.html
Where is the actual prototype exposed to the user declared?
Built-in functions are declared implicitly by GCC. They have no
explicit declarations like user-defined functions. The implicit
internal "declarations" are specified in the GCC internal file
gcc/builtins.def, where they are hidden behind layers of macros.
For example, on the GCC 10 branch, the declaration for
__builtin___clear_cache is here: