Sujet : Re: "A diagram of C23 basic types"
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 09. Apr 2025, 22:56:47
Autres entêtes
Organisation : None to speak of
Message-ID : <87ecy1q9r4.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Gnus/5.13 (Gnus v5.13)
David Brown <
david.brown@hesbynett.no> writes:
On 09/04/2025 11:49, Michael S wrote:
[...]
Are your sure that C Standard does not allow trailing commas?
That is, they are obviously legal in initializer lists.
All compilers that I tried reject trailing comma in function calls.
...
But is it (rejection) really required by the Standard? I don't know.
>
Yes. The syntax (in 6.5.2p1) is :
[...]
Yes, but also no.
A trailing comma in an argument list in a function call is a syntax
error, but the standard doesn't require syntax errors (or constraint
violations) to be fatal. Rejection is required only for #error.
In most cases, most compilers do treat syntax errors as fatal, but for
example a compiler that accepts trailing commas as an extension might
produce a non-fatal warning even in conforming mode.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */