[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: odd compiler behaviour?



On Sun, Mar 16, 2003 at 12:40:52PM +0000, Colin Watson wrote:
> On Sun, Mar 16, 2003 at 04:56:53PM +1100, Rob Weir wrote:
> > On Fri, Mar 14, 2003 at 04:00:22PM +0000, Bruynooghe Floris wrote:
> > > 
> > > int main()
> > 
> > An addition to what everyone else said, this really should be 
> > 
> > int main(int argc, char** argv)
> > 
> > to truly satisfy the pedant within :)
> 
> Doesn't matter if you aren't using them. '()' in C means "unspecified
> arguments", as opposed to "no arguments" which is '(void)'.

In a definition, () and (void) are identical. It's only in the
declaration where () means a fixed but unspecified number of arguments
and only crazy people write declarations for "main".

-- 
echo ">gra.fcw@2ztr< eryyvZ .T pveR" | rot13 | reverse



Reply to: