Jens Gustedt <> writes:
> Am 03.09.2012 21:48, schrieb Herbert Rosenau:
>> Am 02.09.2012 00:59, schrieb Jens Gustedt:
>>> Am 31.08.2012 23:40, schrieb :
>>>> Jens Gustedt <> wrote:
>>>>>
>>>>> But it says so implicitly. Prototypes are defined semantically
>>>>> (6.2.1p2), not through syntax: a declaration of a function that
>>>>> declares the types of its parameters. "void foo() { }" perfectly fits
>>>>> in here, it is a definition and it specifies the number and type of
>>>>> its parameters, namely none.
>>>>
>>>> It's always been understood that a declaration of a function has to use
>>>> a parameter-type-list to declare the types of its parameters;
>>>
>>> Out of curiosity, why did the term prototype then never make it to a
>>> syntactical definition? Do you agree with me that if we stick together
>>> the current text as it stands we have that
>>>
>>> - "void foo() { }" is a defintion of "foo"
>>> - it is also a declaration
>>> - it declares that "foo" has no parameters
>>
>> No, it declares foo as a function with an unknown nuber of parameters
>> with onkown rypes each.
>
> How do you come to that "no". In 6.7.6.3p14 it says
>
>> An empty list in a function declarator that is part of a definition of
>> that function specifies that the function has no parameters.
>
> so you are making the difference that a function "declarator" here
> only "specifies" that the function has no parameters but the
> declarator doesn't "declare" that it has no parameters?
This is a settled question: asked in a Defect Report, and the
response is that this case does not provide a prototype. That
might not be the answer you want, but that's the answer.
> Honestly, I am lost, linguistically.
>
> I think term prototype should have been also defined by syntax,
> perhaps in 6.2.5p20 where function types are introduced or even better
> 6.7.6.3p5 where a simple phrase could be added at the end:
I can't say I agree, but in any case if you want to do something
about it then further comments should be addressed to people
in WG14 (aka "the committee"). Since the question has been
asked and answered through a DR, and no changes have been
made to the text of the Standard, there isn't really anything
people in the newsgroup can do for you.