This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/16907] New: <argp.h> compiled with --std=cXX disables __attribute__


https://sourceware.org/bugzilla/show_bug.cgi?id=16907

            Bug ID: 16907
           Summary: <argp.h> compiled with --std=cXX disables
                    __attribute__
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: minor
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: aurelien at aurel32 dot net
                CC: drepper.fsp at gmail dot com

When <argp.h> is included first and thus __attribute__ is not defined, with
-std=c90, c99 or c11, the __attribute__ is redefined as empty due to the
following code:

#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later.  */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
#  define __attribute__(Spec) /* empty */
# endif

This might break headers included later, for example it breaks
-D_FORTIFY_SOURCE=2 by not defining strcpy() correctly [1]. Besides some
reformating, this code is more than 10 years old, and I don't know if there is
still a reason to redefine __attribute__ that way.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=647084

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]