Article View: gnu.gcc.help
Article #53440Re: conflicts in stddefs.h and sys/stdtypes.h on sunos
From: Bob Craycroft x629
Date: Tue, 28 Jan 1992 18:47
Date: Tue, 28 Jan 1992 18:47
53 lines
3537 bytes
3537 bytes
In article <1992Jan28.125915.21293@iplmail.orl.mmc.com> chucks@iplmail.orl.mmc.com (Chuck Strickland) writes: > the gcc include file stddefs.h attempts to typedef size_t and prtdiff_t. > > But so does the sun include file sys/stdtypes.h. While the gnu include > checks for several defines to determine if these values have been typdefed > the sun include does not define them. Thus errors occur. > > What is the appropriate fix. We started getting the problem with X11R5 > as several .h files there new explicitly include sys/types.h. this occurs > after the gcc stddefs.h include has been included, thus causing the >conflict. > > We are runnin gcc 1.40 and sunos 4.1.1 and X11R5 pl8. I had the same problem. The solutions that appeared in comp.windows.x are below. The 2nd solutionworked for me, i.e., i un-installed assert.h, limits.h, and stddef.h. >From: per@erix.ericsson.se (Per Hedeland) >In article <kmn0ogINN11r@agate.berkeley.edu> stolcke@ICSI.Berkeley.EDU (Andreas Stolcke) writes: >>In article <owie.694904297@jupiter.newcastle.edu.au>, owie@jupiter.newcastle.edu.au (Simon Oldfield) writes: >>|> We are having problems compiling some Xt code ( X11R5 ) with gcc. The >>|> following error results :- >>|> >>|> gcc file.c >>|> In file included from /usr/include/X11/Xlib.h:58, from file.c:2: >>|> /usr/local/lib/gcc-include/stddef.h:16: conflicting types for `ptrdiff_t' >>|> /usr/include/sys/stdtypes.h:28: previous declaration of `ptrdiff_t' >>|> /usr/local/lib/gcc-include/stddef.h:35: conflicting types for `size_t' >>|> /usr/include/sys/stdtypes.h:27: previous declaration of `size_t' >>|> /usr/local/lib/gcc-include/stddef.h:46: conflicting types for `wchar_t' >>|> /usr/include/sys/stdtypes.h:30: previous declaration of `wchar_t' >> >>The easiest way around this seems to be to put >> >>#if HasGcc >>#define StandardDefines -DX_NOT_POSIX /* gcc screws up POSIX compatibility */ >>#endif >> >>in your site.def or xxxx.cf file. > >Another fairly simple way (at least it requires less thought:-) that >"worked for me" on SunOS 4.1.1 is to follow the suggestion in the >release notes: > >"Another common error is likely to be using gcc >ANSI C include files when the vendor operating system supplies correct ones. >The gcc include files assert.h, limits.h, and stddef.h are prime candidates for >not installing." -- Bob Craycroft Harris Semiconductor - RTP, NC Internet: craycrof@rtp.semi.harris.com Phone: (919) 361-1629
Technical Details
Message-ID:
<1992Jan28.184707.15047@mlb.semi.harris.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!darwin.sura.net!mlb.semi.harris.com!altais.rtp.semi.harris.com!craycrofReferences:
<1992Jan28.125915.21293@iplmail.orl.mmc.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,24ba3de91bcfad9 X-Google-Attributes: gid11318c,public X-Google-Thread: 102b08,24ba3de91bcfad9 X-Google-Attributes: gid102b08,public X-Google-Thread: f88e1,24ba3de91bcfad9 X-Google-Attributes: gidf88e1,public X-Google-Thread: 1014db,24ba3de91bcfad9 X-Google-Attributes: gid1014db,public X-Google-ArrivalTime: 1992-01-28 10:59:57 PST Newsgroups: gnu.gcc.help,alt.sys.sun,comp.sys.sun.apps,comp.lang.c Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!darwin.sura.net!mlb.semi.harris.com!altais.rtp.semi.harris.com!craycrof From: craycrof@altais.rtp.semi.harris.com (Bob Craycroft x629) Subject: Re: conflicts in stddefs.h and sys/stdtypes.h on sunos References: <1992Jan28.125915.21293@iplmail.orl.mmc.com> Date: Tue, 28 Jan 1992 18:47:07 GMT Nntp-Posting-Host: altais.rtp.semi.harris.com Organization: Harris Semiconductor, Research Triangle Park, NC Keywords: gcc c stddefs Sender: news@mlb.semi.harris.com Message-ID: <1992Jan28.184707.15047@mlb.semi.harris.com>