Mail Archives: djgpp/2001/07/30/01:00:08
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 -