Article View: gnu.gcc.help
Article #51152Sunos4.1.X <math.h> was: Re: #include <stdio.h>
From: Wolfram Wagner
Date: Tue, 06 Jul 1993 07:45
Date: Tue, 06 Jul 1993 07:45
34 lines
2575 bytes
2575 bytes
In article <2198vm$2m6@dux.dundee.ac.uk>, ndevnani@dee.mcs.dundee.ac.uk (ndevnani@uk.ac.dundee.mic) writes: > Hi All, > We're using gcc with the -ansi switch on SunOS 4.1.2 and getting > compiler errors in the math.h header file which is included in the > source. > Does anyone have any idea what this could be? My initial reaction was > math.h with cc (which is not ansi) is being included instead of > header files supplied with gcc and causing problems but the more > I think about it the more I'm unconvinced as there are no problems > with the other commmon header files. > If anyone has any ideas, I'd be grateful. > > Many thanks, > Nigel Devnani, University of Dundee, Scotland, UK. > e:mail ndevnani@uk.ac.dundee.mi We had the same problem here some time ago, and i found out the following facts about it: In math.h (or some file included in there, i am not so sure about this) there are several (co-)processor specific definitions. These are switched by "#ifdef"s for "sparc" "68k" or so. Those Definitions are removed from the list of predefinitions of the gnu cpp if "-ansi" is in effect, along with any predefinitions not starting with "__". You may just leave "-ansi" away if you do not really need it or add the definitions (-Dsparc) in the compiler call (CFLAGS= ... -Dsparc). The option "-ansi" is only necessary if you want to omit all ansi supersets for compatibility or need e.g. trigraphs (do you?). I could compile all ansi-compliant programs without this option up to now. Leaving this option away does not mean that gcc behaves like a K&R Compiler! Wolfram Wagner Email: ww@mpi-sb.mpg.de Max-Planck-Institut fuer Informatik Tel.: +49-681/302-5403 Im Stadtwald Fax: +49-681/302-5401 66123 Saarbruecken GERMANY
Technical Details
Message-ID:
<21baj7INNnu6@sbusol.rz.uni-sb.de>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!news.dfn.de!coli.uni-sb.de!sbusol.rz.uni-sb.de!mpi-sb.mpg.de!wwReferences:
<2198vm$2m6@dux.dundee.ac.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,bbfe9e553dfd8370 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-07-06 03:12:22 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!news.dfn.de!coli.uni-sb.de!sbusol.rz.uni-sb.de!mpi-sb.mpg.de!ww From: ww@mpi-sb.mpg.de (Wolfram Wagner) Newsgroups: gnu.gcc.help Subject: Sunos4.1.X <math.h> was: Re: #include <stdio.h> Date: 6 Jul 1993 07:45:43 GMT Organization: Max-Planck-Institut fuer Informatik Lines: 34 Distribution: world Message-ID: <21baj7INNnu6@sbusol.rz.uni-sb.de> References: <2198vm$2m6@dux.dundee.ac.uk> NNTP-Posting-Host: mpii-ww.zb.mpi-sb.mpg.de Keywords: math.h