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

            Bug ID: 120570
           Summary: -pedantic option may not direct GCC to print a warning
                    message if __attribute__ feature is used
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pavel.morozkin at gmail dot com
  Target Milestone: ---

GCC documentation (https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html) says:
> GNU C provides several language features not found in ISO standard C. (The 
> -pedantic option directs GCC to print a warning message if any of these 
> features is used.) 

For Common Function Attribute
(https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html)
__attribute__ ((access (read_only, 1))) -pedantic option may not direct GCC to
print a warning message.

Example:
__attribute__ ((access (read_only, 1)))
int puts (const char* x);

compiled with GCC 14.1 with options -O3 -std=c11 -pedantic -Wall -Wextra does
not produce a warning.

Per ISO C11 the code above may lead to syntax error, which is required to be
diagnosed.

Reply via email to