This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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 other/83826] New: Fixinclude creates redefinitions


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

            Bug ID: 83826
           Summary: Fixinclude creates redefinitions
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: coypu at sdf dot org
  Target Milestone: ---

At least on netbsd:

#include <stdint.h>
#include <sys/time.h>

int main() { return 0; }


> /usr/pkg/gcc8snapshot/bin/gcc -ffreestanding -Wsystem-headers test.c

In file included from /usr/include/amd64/int_limits.h:36,
                 from /usr/include/sys/stdint.h:92,
                 from /usr/include/sys/bswap.h:9,
                 from /usr/include/amd64/bswap.h:13,
                 from /usr/include/sys/endian.h:107,
                 from /usr/include/amd64/endian.h:3,
                 from
/usr/pkg/gcc8snapshot/lib/gcc/x86_64--netbsd/8.0.0/include-fixed/sys/types.h:107,
                 from /usr/include/sys/time.h:38,
                 from test.c:2:
/usr/include/sys/common_int_limits.h:46: warning: "INT8_MIN" redefined
 #define INT8_MIN  (-__INT8_MAX__-1)

In file included from
/usr/pkg/gcc8snapshot/lib/gcc/x86_64--netbsd/8.0.0/include/stdint.h:11,
                 from test.c:1:
/usr/pkg/gcc8snapshot/lib/gcc/x86_64--netbsd/8.0.0/include/stdint-gcc.h:103:
note: this is the location of the previous definition
 # define INT8_MIN (-INT8_MAX - 1)


Repeating for a lot of things.



using -save-temps, it seems we have include order:
fixincludes stdint.h:

  #undef WORKING_THING
  #define WORKING_THING 0x7f

normal stdint.h:
  #define WORKING_THING 0x7F

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