public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/65238] New: [5 Regression] __has_attribute is not handled properly with -traditional-cpp.
@ 2015-02-27 14:20 iains at gcc dot gnu.org
  2015-02-27 18:44 ` [Bug preprocessor/65238] " mpolacek at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: iains at gcc dot gnu.org @ 2015-02-27 14:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65238
           Summary: [5 Regression] __has_attribute is not handled properly
                    with -traditional-cpp.
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org

Created attachment 34890
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34890&action=edit
trivial test-case.

between r218893 and 218951 the handling of __has_attribute has regressed for
-traditional-cpp (-E)

(as an example) gcc.dg/cpp/trad/include.c has started to fail with excess
errors - if run manually:

$ ./gcc/xgcc -Bgcc /GCC/gcc-trunk/gcc/testsuite/gcc.dg/cpp/trad/include.c
-traditional-cpp  -E -m32 -o include.i
In file included from /usr/include/Availability.h:145:0,
                 from /usr/include/stdlib.h:62,
                 from
/GCC/gcc-trunk/gcc/testsuite/gcc.dg/cpp/trad/include.c:13:
/usr/include/AvailabilityInternal.h:1036:0: error: missing '(' after
"__has_attribute"
     #ifdef __has_attribute
 ^
/usr/include/AvailabilityInternal.h:1037:0: error: missing '(' after
"__has_attribute"
         #if __has_attribute(availability)
 ^
=====

The trivial test-case compiles fine with:
$ ./gcc/xgcc -Bgcc has-attr.c -E -o t.i

and with :
$ ./gcc/xgcc -Bgcc has-attr.c -E -traditional-cpp -o t.i
has-attr.c:3:0: error: missing '(' after "__has_attribute"
 # if __has_attribute(__totally_non_existant__)
 ^
cc1(52597) malloc: *** error for object 0x1421194c8: incorrect checksum for
freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
cc1(52597) malloc: *** error for object 0x142119438: incorrect checksum for
freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

====

Of course, it seems reasonable to exclude __has_attribute from traditional-cpp
- but, in that case:
(a) the testsuite needs amendment in some places, and
(b) use of the tag should not cause the free error.


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

end of thread, other threads:[~2015-03-23  8:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-27 14:20 [Bug c/65238] New: [5 Regression] __has_attribute is not handled properly with -traditional-cpp iains at gcc dot gnu.org
2015-02-27 18:44 ` [Bug preprocessor/65238] " mpolacek at gcc dot gnu.org
2015-03-05 10:49 ` mpolacek at gcc dot gnu.org
2015-03-07 20:59 ` iains at gcc dot gnu.org
2015-03-07 21:05 ` mpolacek at gcc dot gnu.org
2015-03-08 10:36 ` ktietz at gcc dot gnu.org
2015-03-09 12:39 ` jakub at gcc dot gnu.org
2015-03-11 15:50 ` jakub at gcc dot gnu.org
2015-03-23  9:03 ` jakub at gcc dot gnu.org
2015-03-23  9:21 ` jakub 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).