Article View: comp.sys.mac.programmer.codewarrior
Article #18Re: ANSI standards
From: Dietmar Kuehl
Date: Thu, 14 Dec 1995 20:54
Date: Thu, 14 Dec 1995 20:54
22 lines
1512 bytes
1512 bytes
Hi, G. Ruth Hammond (hammond_g@drkclu.meng.ucl.ac.uk) wrote: : 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() The two portable declarations of 'main()' are (3.6.1, basic.start.main, verse 2 of the April DWP): int main() int main(int ac, char *av[]) All other declarations of 'main()' are non-portable but every conforming C++ (or C) compiler has to provide at least the two mentioned above. -- dietmar.kuehl@uni-konstanz.de http://www.informatik.uni-konstanz.de/~kuehl I am a realistic optimist - that's why I appear to be slightly pessimistic
Technical Details
Message-ID:
<30d08f17.0@news.uni-konstanz.de>Path:
arc1-ca.pugleaf.net!news.uni-konstanz.de!uzwil!kuehlReferences:
<1995Dec14.120627.31590@ucl.ac.uk>Show Full Headers
Complete Article Headers
From: kuehl@uzwil.informatik.uni-konstanz.de (Dietmar Kuehl) Subject: Re: ANSI standards Newsgroups: comp.sys.mac.programmer.codewarrior,comp.lang.c++ Followup-To: comp.sys.mac.programmer.codewarrior,comp.lang.c++ References: <1995Dec14.120627.31590@ucl.ac.uk> Organization: Fakultät für Mathematik und Informatik Reply-To: dietmar.kuehl@uni-konstanz.de X-Newsreader: TIN [version 1.2 PL2] NNTP-Posting-Host: news.uni-konstanz.de Message-ID: <30d08f17.0@news.uni-konstanz.de> Date: 14 Dec 95 20:54:47 GMT Path: arc1-ca.pugleaf.net!news.uni-konstanz.de!uzwil!kuehl