🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #16

ANSI standards

#16
From: G. Ruth Hammond
Date: Thu, 14 Dec 1995 12:06
23 lines
1488 bytes
Using Metrowerks CodeWarrior C++ on my LC475 I declare main as void main(void)
and it compiles ok, but using DEC C++ on an alpha it insists on int main(void) 
and won't compile otherwise. CodeWarrior won't compile it with an int main
(void), it gives link errors. My code is a very simple model of a 4 stroke
engine using an "engine" class and reading characteristic data from a disk
file, and terminating with exit()

hmmm...

I'm using the standard ANSI stationery on CodeWarrior7 with the preferences
set to ANSI strict and DEC C++ Version V1.3A-0 on OpenVMS AXP version V6.1-1H1

which one is the correct ANSI standard? and is there a way to ensure my source
will compile without modification on both platforms (maybe with #ifdef?)



-- 
*    Guy Ruth Hammond - cold, tired, lonely, hungry and depressed    *
* Undergraduate at University College London, Mechanical Engineering *
* hammond_g@meng.ucl.ac.uk | http://www.ucl.ac.uk/~zcemm23/home.html *
*                Clear the DECs, it's time for action!               *
Technical Details
Message-ID: <1995Dec14.120627.31590@ucl.ac.uk>
Path: arc1-ca.pugleaf.net!drkclu.meng.ucl.ac.uk!hammond_g

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.mac.programmer.codewarrior,comp.lang.c++
Path: arc1-ca.pugleaf.net!drkclu.meng.ucl.ac.uk!hammond_g
From: hammond_g@drkclu.meng.ucl.ac.uk (G. Ruth Hammond)
Subject: ANSI standards
Sender: news@ucl.ac.uk (Usenet News System)
Message-ID: <1995Dec14.120627.31590@ucl.ac.uk>
Date: Thu, 14 Dec 1995 12:06:27 GMT
Reply-To: hammond_g@drkclu.meng.ucl.ac.uk (G. Ruth Hammond)
Organization: UCL Dept Mech Eng
X-Newsreader: mxrn 6.18-9