Deutsch   English   Français   Italiano  
<20250410114252.0000218a@yahoo.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Michael S <already5chosen@yahoo.com>
Newsgroups: comp.lang.c
Subject: Re: "A diagram of C23 basic types"
Date: Thu, 10 Apr 2025 11:42:52 +0300
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <20250410114252.0000218a@yahoo.com>
References: <87y0wjaysg.fsf@gmail.com>
	<vsj1m8$1f8h2$1@dont-email.me>
	<vsj2l9$1j0as$1@dont-email.me>
	<vsjef3$1u4nk$1@dont-email.me>
	<vsjg6t$20pdb$1@dont-email.me>
	<vsjgjn$1v1n4$1@dont-email.me>
	<vsjk4k$24q5m$1@dont-email.me>
	<vsjlcp$230a5$1@dont-email.me>
	<vsjmdl$277bk$1@dont-email.me>
	<VsdHP.1828827$TBhc.1078002@fx16.iad>
	<vskjlo$34st8$1@dont-email.me>
	<20250402220614.431@kylheku.com>
	<85mscxlqnb.fsf@nosuchdomain.example.com>
	<vsl9sn$3vdjj$2@dont-email.me>
	<20250403121946.134@kylheku.com>
	<vsms75$1i8ud$1@dont-email.me>
	<vsnhq6$291i3$4@dont-email.me>
	<20250409124900.00000fa1@yahoo.com>
	<861pu1ccsg.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Apr 2025 10:42:52 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="52a9426fb6be992bf0be892ea51bbb02";
	logging-data="1016382"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+bmM45dcx/I81S2eZWFuVB1Jj8unmpPI4="
Cancel-Lock: sha1:SXmrL7RMflXDoTiPKCfhmDPH3xQ=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
Bytes: 3753

On Wed, 09 Apr 2025 13:14:55 -0700
Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

> Michael S <already5chosen@yahoo.com> writes:
> 
> > On Fri, 4 Apr 2025 02:57:10 -0000 (UTC)
> > Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> >  
> >> On Thu, 3 Apr 2025 21:48:40 +0100, bart wrote:
> >>  
> >>> Commas are overwhelmingly used to separate list elements in
> >>> programming languages.  
> >>
> >> Not just separate, but terminate.  
> >
> > I disagree.  I am in favor of optional trailing commas rather than
> > mandatory ones.
> >  
> >> All the reasonable languages allow
> >> trailing commas.  
> >
> > 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.
> >
> > For example
> >
> > void bar(int);
> > void foo(void) {
> >   bar(1,);
> > }
> >
> > MSVC:
> > comma.c(3): error C2059:  syntax error: ')'
> >
> > clang:
> > comma.c:3:9: error: expected expression
> >     3 |   bar(1,);
> >       |         ^
> >
> > gcc:
> > comma.c:  In function 'foo':
> > comma.c:3:9: error: expected expression before ')' token
> >     3 |   bar(1,);
> >       |         ^
> > comma.c:3:3: error: too many arguments to function 'bar'
> >     3 |   bar(1,);
> >       |   ^~~
> > comma.c:1:6: note:  declared here
> >     1 | void bar(int);
> >       |      ^~~
> >
> > But is it (rejection) really required by the Standard?  I don't
> > know.  
> 
> It is required in the sense that it is a syntax error,
> and syntax errors require a diagnostic.
> 
> Trailing commas in argument lists and/or parameter lists
> could be accepted as an extension, even without giving a
> diagnostic as I read the C standard, but implementations
> are certainly within their rights to reject them.

I have no doubts that implementations have full rights to reject them.
The question was about possibility to accept them and especially about
possibility to accept without diagnostics.
So, it seems, there is no consensus about it among few posters that
read the relevant part of the standard.