Bug 2752 - dont redefine __attribute__ in error.h with -std=c99
Summary: dont redefine __attribute__ in error.h with -std=c99
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-10 14:28 UTC by Mike Frysinger
Modified: 2014-07-04 22:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
glibc-error-header-updates.patch (881 bytes, patch)
2006-06-10 14:29 UTC, Mike Frysinger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger 2006-06-10 14:28:50 UTC
we hit a neat little error with some code when including error.h and 
using -std=c99 ... the question is whether this is a feature :)

take for example the attached code ... when built with -std=c99, 
__STRICT_ANSI__ is defined by gcc which causes error.h to macro away the gcc  
__attribute__ extension since gcc doesnt consider __attribute__ to ever be 
defined

perhaps a better idea would be to use __error_attribute__ inside of the header 
so that it doesnt pollute the namespace of the code that includes it ... 
patch attached
Comment 1 Mike Frysinger 2006-06-10 14:29:08 UTC
Created attachment 1078 [details]
glibc-error-header-updates.patch
Comment 2 Ulrich Drepper 2006-06-13 15:34:55 UTC
__STRICT_ANSI__ is nonsense.  If you want to write a strict ANSI C program stop
using non-ANSI code from the system.  That flag must go, fix the real reason
instead of working around it.
Comment 3 Mike Frysinger 2006-07-03 21:02:53 UTC
if it's such nonsense, then why not just drop it from error.h ?  if error.h is a
non-ansi header then there's no point in checking for ansi in it
Comment 4 Ulrich Drepper 2006-08-12 20:30:40 UTC
Stop reopening bugs.  The file is used elsewhere and I don't make any unnecesary
changes.