Bug 83826 - Fixinclude creates redefinitions
Summary: Fixinclude creates redefinitions
Status: WAITING
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-13 05:52 UTC by coypu
Modified: 2018-01-16 05:39 UTC (History)
0 users

See Also:
Host:
Target: *-*-netbsd*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-01-15 00:00:00


Attachments
fixed sys/types.h (3.55 KB, text/x-csrc)
2018-01-16 05:35 UTC, coypu
Details
Normal sys/types.h (3.40 KB, text/plain)
2018-01-16 05:39 UTC, coypu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description coypu 2018-01-13 05:52:46 UTC
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
Comment 1 Richard Biener 2018-01-15 09:16:48 UTC
Can you attcah both fixed and unfixed sys/types.h?
Comment 2 coypu 2018-01-16 05:35:43 UTC
Created attachment 43145 [details]
fixed sys/types.h
Comment 3 coypu 2018-01-16 05:39:54 UTC
Created attachment 43146 [details]
Normal sys/types.h