public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107947] New: __has_c_attribute incorrectly identifies attribute as supported
@ 2022-12-01 13:43 xen0n at gentoo dot org
  2022-12-01 13:44 ` [Bug c/107947] " xen0n at gentoo dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: xen0n at gentoo dot org @ 2022-12-01 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107947
           Summary: __has_c_attribute incorrectly identifies attribute as
                    supported
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xen0n at gentoo dot org
  Target Milestone: ---

Created attachment 53999
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53999&action=edit
minimal reproducing example

The gcc trunk incorrectly indicates that the [[noreturn]] spelling of the
noreturn attribute works on -std=gnu99 with the attached source:

> $ ./gcc/xgcc -B./gcc -E -P -std=gnu99 ../x.h
> C standard version is 199901L, has "__has_c_attribute"
> "__has_c_attribute(noreturn)" = 202202

This is commit abf05583dbc86a6667b63f5bda6ba57fe55a1b25, while:

> $ gcc-12.1.1 -E -P -std=gnu99 x.h
> C standard version is 199901L, has "__has_c_attribute"
> "__has_c_attribute(noreturn)" = 0

and:

> $ clang-15 -E -P -std=gnu99 x.h
> 
> C standard version is 199901L, has "__has_c_attribute"
> "__has_c_attribute(noreturn)" = 0

I haven't bisected yet but can help doing so if necessary. One of the affected
code in the wild is the fresh tzdb-2022g from https://www.iana.org/time-zones.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-23 15:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 13:43 [Bug c/107947] New: __has_c_attribute incorrectly identifies attribute as supported xen0n at gentoo dot org
2022-12-01 13:44 ` [Bug c/107947] " xen0n at gentoo dot org
2022-12-01 13:48 ` pinskia at gcc dot gnu.org
2022-12-01 14:51 ` redi at gcc dot gnu.org
2022-12-01 15:34 ` pinskia at gcc dot gnu.org
2022-12-01 18:40 ` eggert at cs dot ucla.edu
2022-12-23 15:46 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).