https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119660

            Bug ID: 119660
           Summary: builtin functions erroneously suggested as originating
                    in system headers
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

While investigating an unrelated bug in
gcc.dg/Wbuiltin-declaration-mismatch-16.c, I noticed that the output of the
compiler included peculiar messages:

Relevant line:
void __builtin_abort (int[foo]);

Output:
gcc.dg/Wbuiltin-declaration-mismatch-16.c:5:27: error: 'foo' undeclared here
(not in a function)
gcc.dg/Wbuiltin-declaration-mismatch-16.c:5:6: warning: conflicting types for
built-in function '__builtin_abort'; expected 'void(void)'
[-Wbuiltin-declaration-mismatch]
gcc.dg/Wbuiltin-declaration-mismatch-16.c:5:6: note: '__builtin_abort' is
declared in header '<stdlib.h>'


It seems that under certain conditions, GCC suggests to include a C header file
to get the definition of a builtin function.  That test tests 4 builtins in
various ways.  2 of them exhibit this behavior, the other being __builtin_exit.

Reply via email to