delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/02/08:15:37

From: loki AT nectar DOT com DOT au-remove (loki)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: A nice trap! (2)
Date: 2 Jun 98 11:59:51 GMT
Organization: Nectar Online Services
Lines: 25
Message-ID: <slrn6n7qds.46.loki@anima.nectar.com.au>
References: <35715AA9 DOT 4222FD24 AT net4you DOT co DOT at> <35718841 DOT 1129 AT cs DOT com>
NNTP-Posting-Host: 203.18.79.30
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

John M. Aldrich <fighteer AT cs DOT com> wrote:

>BTW, your test program has some significant flaws.  First, main() must
>return an integer according to the ANSI standard.

  I agree, this is something a lot of people don't seem to realise, not that
I think it matters too much as long as people:
a) realise it technically isn't ANSI-compliant
b) don't try to get main() to return something!

> Second, library
>functions like printf() must be prototyped by including the appropriate
>standard header file, in this case stdio.h.

  I'm not sure about this.  I was under the impression that function
prototypes are not strictly required by ANSI.  Of course it's better to have
them so as to have better compile-time checking of function arguments, but I
didn't think it was strictly compulsory.


-- 
       loki
loki (at) nectar.com.au         http://puck.nether.net/~loki/
# Dare I disturb the universe?  You bet I do!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019