[MPlayer-dev-eng] [PATCH] Automatic downmix

Nicolas George nicolas.george at normalesup.org
Wed Sep 8 19:46:27 CEST 2010


[ This is quite off-topic; I'll shut up after this message. ]

Le duodi 22 fructidor, an CCXVIII, Diego Biurrun a écrit :
> It's the C standard that requires it, actually.  'void' denotes a
> parameterless function, while an empty parameter list denotes a
> variable list of parameters.

That makes it legal. It is a matter of coding style whether to accept it or
not.

Although, I think it is more complicated than that. C99 says:

# An empty list in a function declarator that is part of a definition of
# that function specifies that the function has no parameters. The empty
# list in a function declarator that is not part of a definition of
# that function specifies that no information about the number or types
# of the parameters is supplied.

As I understand this paragraph, "void foo();" declares foo with a
variable/unspecified list of parameters, but "void foo() { something }"
defines foo with an empty list of parameters, just like "void foo(void) { }".

C99 also says:

# The use of function declarators with empty parentheses is an obsolescent
# feature.

But I am not sure whether that means that "void foo()" will be illegal or
equivalent to "void foo(void)" like it is in c++.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100908/68338180/attachment.pgp>


More information about the MPlayer-dev-eng mailing list