https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108700
Bug ID: 108700 Summary: false _Noreturn error with -Werror=old-style-declaration Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: vincent-gcc at vinc17 dot net Target Milestone: --- With gcc-12 (Debian 12.2.0-14) 12.2.0 (but this error was already present in GCC 4.8): cventin% echo 'int _Noreturn does_not_return (void) { for (;;) continue; }' | gcc-12 -xc -c -Werror=old-style-declaration - <stdin>:1:1: error: ‘_Noreturn’ is not at beginning of declaration [-Werror=old-style-declaration] cc1: some warnings being treated as errors This error is incorrect. The grammar in ISO C17 is function-definition: declaration-specifiers declarator declaration-listopt compound-statement declaration-specifiers: storage-class-specifier declaration-specifiersopt type-specifier declaration-specifiersopt type-qualifier declaration-specifiersopt function-specifier declaration-specifiersopt alignment-specifier declaration-specifiersopt where "int" is part of type-specifier and "_Noreturn" is part of function-specifier, so that they can be in any order. Note that the int _Noreturn does_not_return (void) { for (;;) continue; } comes from one of the autoconf tests, which fails as a consequence.