🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4783

Is a diagnostic required?

#4783
From: Dan Pop
Date: Thu, 22 Feb 1996 14:35
27 lines
1037 bytes
Hi,

Does the following code require a diagnostic?

    foo()
    {
    }

    main()
    {
	foo(3);
    }

I was always convinced that there is no difference between foo() and
foo(void) in the _definition_ of the function foo and that 'void' as the
argument list of a function was introduced for function declarations,
because an empty argument list in a function declaration had to be
treated as in K&R C.  Yet, all the compilers I tried accepted this code
without complaint and complained when 'void' was introduced in the
definition of foo.

Dan
--
Dan Pop
CERN, CN Division
Email: danpop@mail.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
Technical Details
Message-ID: <danpop.824999740@rscernix>
Path: arc1-ca.pugleaf.net!rcp6.elan.af.mil!rscernix!danpop

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!rcp6.elan.af.mil!rscernix!danpop
From: danpop@mail.cern.ch (Dan Pop)
Newsgroups: comp.std.c
Subject: Is a diagnostic required?
Date: 22 Feb 96 14:35:40 GMT
Organization: CERN European Lab for Particle Physics
Message-ID: <danpop.824999740@rscernix>
NNTP-Posting-Host: ues5.cern.ch
X-Newsreader: NN version 6.5.0 #7 (NOV)