🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.bugs
Article #55

Re: gcc preprocessor and -traditional problem

#55
From: Dave Hess
Date: Tue, 12 Jan 1993 17:46
58 lines
2548 bytes
In article <1it2rtINNk7i@tamsun.tamu.edu> d1h1883@sc.tamu.edu (Dave Hess)  
writes:
 > 
 > I was trying to put together a package (detex 2.4) that needed to be  
compiled
 > with -traditional and gcc puked on some NeXT include files. gcc apparently
 > won't interpret the funky macros that NeXT uses in some of their #include
 > statements (for the architecture independent stuff) if the -traditional
 > switch is on.
 > 

Apparently this is a bug and is known. I was forwarded the following.

 > From: Kate Smith <Kate_Smith@NeXT.COM>
 > Date: Wed, 30 Dec 92 14:43:55 -0800
 > To: <serge@Princeton.EDU>
 > Subject: [37670] @!compiler problems - something about the comments in  
math.h
 >
 > Serge,
 > We have a bug with our machine dependant include files when using the  
-traditional flag.  We have an include file that is used to build the name of  
the machine dependant include file that really needs to be included.  This  
file uses an ansi directive that is invalid in traditional mode.
 >
 > So in order for you to get the math.h file included, you need to specify  
the fullpath in your program, or modify math.h to include the proper file.
 >
 > So your program would look like this:
 > 	#include </NextDeveloper/Headers/ansi/m68k/math.h>
 >
 > 	main()
 > 	{
 > 		double x;
 > 		x=cos(1.2); 
 > 		printf("%f\n",x);
 > 	}
 >
 > Or you could change math.h to include  
/NextDeveloper/Headers/ansi/m68k/math.h instead of doing the machine  
dependant stuff.
 >
 > Sorry for the inconvenience.
 >
 > Kate

It looks like the workaround is to fully qualify pathnames. The problem
is that this won't work on include files that include others. i.e.
<sys/param.h>. I would have to expand by hand all of macros. Ugh.

Thanks to Serge J. Goldstein for the info.

Dave

--
David K. Hess
Graduate Assistant                     David-Hess@tamu.edu
Supercomputer Center                  Texas A&M University
Technical Details
Message-ID: <1iv06bINNqft@tamsun.tamu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!bogus.sura.net!howland.reston.ans.net!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!tamsun.tamu.edu!tamsun.tamu.edu!news
References: <1it2rtINNk7i@tamsun.tamu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!bogus.sura.net!howland.reston.ans.net!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!tamsun.tamu.edu!tamsun.tamu.edu!news
From: d1h1883@sc.tamu.edu (Dave Hess)
Newsgroups: comp.sys.next.bugs
Subject: Re: gcc preprocessor and -traditional problem
Date: 12 Jan 1993 17:46:51 GMT
Organization: Texas A&M University, College Station, TX
Lines: 58
Distribution: world
Message-ID: <1iv06bINNqft@tamsun.tamu.edu>
References: <1it2rtINNk7i@tamsun.tamu.edu>
Reply-To: David-Hess@tamu.edu
NNTP-Posting-Host: posaune.tamu.edu