Date: Fri, 17 Apr 1998 14:10:02 -0700 (PDT) From: Thomas David Rivers <rivers@dignus.com> To: freebsd-bugs Subject: Re: bin/6332: time.h doesn't compile with -traditional Message-ID: <199804172110.OAA27974@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/6332; it has been noted by GNATS. From: Thomas David Rivers <rivers@dignus.com> To: bde@zeta.org.au, FreeBSD-gnats-submit@FreeBSD.ORG Cc: Subject: Re: bin/6332: time.h doesn't compile with -traditional Date: Fri, 17 Apr 1998 15:37:09 -0400 (EDT) Bruce Evans writes: > The following reply was made to PR bin/6332; it has been noted by GNATS. > > From: Bruce Evans <bde@zeta.org.au> > To: FreeBSD-gnats-submit@FreeBSD.ORG, sastdr@unx.sas.com > Cc: Subject: Re: bin/6332: time.h doesn't compile with -traditional > Date: Sat, 18 Apr 1998 04:05:28 +1000 > > >>Description: > > > > I continue to compile some software with -traditional; because > > it may not compile on other hosts and I'd like to "catch" this on > > FreeBSD before it gets there. > >... > >>Fix: > > > > Replace uses of 'const' with the __const keyword defined in cdefs.h. > > `const' is used on about 561 lines in /usr/include/*.h, 244 lines in > /usr/include/sys/*.h, ... It is too late to uglify them all. It's too late? I didn't know changes were limited by the calendar :-) Granted, it may be too late for 2.2.6 (certainly) and likely even 3.0, but what about future versions? > > <sys/cdefs.h> defines away `const' (and other ANSI-only keywords) > unless NO_ANSI_KEYWORDS or __GNUC__ is defined. It is assumed that > `gcc -traditional' is only used to compile dusty code that uses > these keywords as normal identifiers. If your code doesn't have > such identifiers then you can easily define away the identifiers > directly by compiling with `gcc -traditional -Dconst='. Umm... that's not the assumption I was using. And, it would seem that, even if that's the assumption, it doesn't work... I can by the statement that "-traditional simply doesn't work" - if that's what we want to make... seems to me, given the assumption I was making (see next paragraph) that making -tradition "work" is worthwhile, for some... I was using gcc -traditional to ensure my code will compile on platforms where I don't have an ANSI compiler... as a test case. And, I then discovered FreeBSD's code wouldn't work there either... I agree, your point of defining 'const' away is a good workaround. - Dave Rivers - To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804172110.OAA27974>