🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #54268

Re: non-ANSI stdlib.h?

#54268
From: Michael K. Gschwind
Date: Fri, 04 Jan 1991 13:58
36 lines
2282 bytes
In article <1869@fornax.UUCP> dyck@cs.sfu.ca writes:
>The problem is that our system's /usr/include/stdlib.h is not ANSI-
>conformant (e.g., it doesn't have strtod or strtol). So compilation 
>errors arise.
>
>In general, then, the question is: How is gcc supposed to be an ANSI C
>compiler if it depends on files that may not be ANSI-conformant (and
>perhaps might not even exist)?

GCC can _never_ be fully ANSI-compliant, if it's running on a non-ANSI
compliant system. ANSI C not only defines the compiler, but also the
environment, i.e., the header files, the library, defined symbols, etc.

Now, if your system does not supply an ANSI library or ANSI header
files, you will never be able to be fully ANSI compliant. Some hacks
will let you compile most ANSI-C stuff, however. Copy stdlib.h to
.../gcc-include, hack it to include strtod and strtol and link with a
library which implements these functions. This is probably as far ANSI
compliant as you can get on your system. Only really awful programs will
run into problems after this. (You still may have the problem of
functions defined which should not be there and get a name collision or
things like that, but these should not happen too often.) One problem
you will probably not be able to fix is if your system has semantics
different from the ANSI one in several system calls. 


				Good luck,
					mike
	

Michael K. Gschwind, Institute for VLSI-Design, Vienna University of Technology
mike@vlsivie.tuwien.ac.at	1-2-3-4 kick the lawsuits out the door 
mike@vlsivie.uucp		5-6-7-8 innovate don't litigate         
e182202@awituw01.bitnet		9-A-B-C interfaces should be free
Voice: (++43).1.58801 8144	D-E-F-O look and feel has got to go!
Fax:   (++43).1.569697       
Technical Details
Message-ID: <2222@tuvie.UUCP>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!tuvie!mike
References: <1869@fornax.UUCP>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,951182e47a8e0fb9
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1991-01-04 06:20:23 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!tuvie!mike
From: mike@vlsivie.tuwien.ac.at (Michael K. Gschwind)
Newsgroups: gnu.gcc.help
Subject: Re: non-ANSI stdlib.h?
Message-ID: <2222@tuvie.UUCP>
Date: 4 Jan 91 13:58:36 GMT
References: <1869@fornax.UUCP>
Sender: news@tuvie.UUCP
Distribution: gnu
Organization: Vienna University of Technology
Lines: 36