🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4984

int main(void) or int main()?

#4984
From: Bruno RICHARD
Date: Thu, 04 Apr 1996 19:21
13 lines
911 bytes
What is the recommended declaration for a function that does
not take arguments and does not return anything:

   void myfunc();
or
   void myfunc(void);

I remember that few years ago on Turbo C 2.0 the second form was better
optimized. So I got used to do so, but I just read the C FAQ and noticed
that there was some argument about main() returning int or void, and
I am wondering whether there could be some portability problems around.

-bruno
Technical Details
Message-ID: <4k17gf$gob@isoit109.bbn.hp.com>
Path: arc1-ca.pugleaf.net!isonews.bbn.hp.com!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!isonews.bbn.hp.com!news
From: Bruno RICHARD <bruno_richard@hp-france-om1.om.hp.com>
Newsgroups: comp.std.c
Subject: int main(void) or int main()?
Date: 4 Apr 1996 19:21:51 GMT
Organization: Hewlett-Packard
Message-ID: <4k17gf$gob@isoit109.bbn.hp.com>
NNTP-Posting-Host: gplbrd.grenoble.hp.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.2N (Windows; I; 16bit)