delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/30/01:00:08

From: Jack Klein <jackklein AT spamcop DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: char* []={"a",}
Message-ID: <3np9mtc4mkf2phc4kofmd4hfsh674i64l6@4ax.com>
References: <9k16gl$pr8$1 AT info DOT cyf-kr DOT edu DOT pl>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Lines: 27
Date: Mon, 30 Jul 2001 04:49:20 GMT
NNTP-Posting-Host: 12.84.7.220
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 996468560 12.84.7.220 (Mon, 30 Jul 2001 04:49:20 GMT)
NNTP-Posting-Date: Mon, 30 Jul 2001 04:49:20 GMT
Organization: AT&T Worldnet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Sun, 29 Jul 2001 16:19:53 +0200, "Rafal Maj (Raf256)"
<raf256 AT go2 DOT pl> wrote in comp.os.msdos.djgpp:

> DJGPP allows statment like
> const char* arr[]{"aaa","bbb",};
> with extra "," at end is't this a bug ?

No, it is specifically allowed under the ANSI/ISO C standard, and
inherited from there by the ANSI/ISO C++ standard.  It does nothing at
all.

Originally, due to an oversight in writing the standard, an extra
comma was illegal at the end of an enumeration definition in C:

enum { ZERO, ONE, TWO, };

...but most compilers accepted it anyway.  The oversight was corrected
in the 1999 update to the C standard and it is now legal to have an
extra trailing comment (one only) in an enum definition as well.

-- 
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019