Re: [Dev-C++] c++ style comments and porting problems
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <cg...@wo...> - 2002-12-18 12:08:01
|
Ger...@ne... wrote: >Message: 1 >Date: Tue, 17 Dec 2002 18:08:11 +0100 >From: =?ISO-8859-1?Q?Carlos_Garc=EDa_del_Monte?= <cg...@wo...> >To: dev-cpp-users-list <dev...@li...> >Subject: Re: [Dev-C++] ANSI C project > >You used C++ style comments? >mingw generates millions errors if you use them in a C progam; you can >maintain them if you add the -std=c99 option to the compiler (in mingw >2.0.0, based on gcc3.2,. If you use previous version, based on gcc 2.95.3-6 > perhaps then you need change the comment style) > >/*****so thats the command line option*******************************/ >/**************************thanks dude*******************************/ > > I'm not sure of understanding this reply, but this is the answer to what I've understood: The option for support ANSI C which Mrs Teresa is talking about, is the one you set by clicking "support traditional ANSI C" option in compiler's options dialog. That sets the command line option -ansi, which is not the same than -std=c99. -ansi stands for -std=c89. The C++ style comments are accepted from 1999 ANSI C standard, so any option telling the compiler to be within any previous ANSI standard previous to c99 (which is the last one) won't accept c++ style comments in a c source. The default is std=gnu89, which is the 99 standard plus gnu extensions. 99 standard is not fully supported right now, when it be, it will be the default. In gcc-3.2.chm file: "C++ Style Comments In GNU C, you may use C++ style comments, which start with // and continue until the end of the line. Many other C implementations allow such comments, and they are likely to be in a future C standard. However, C++ style comments are not recognized if you specify -ansi, a -std option specifying a version of ISO C before C99, or -traditional, since they are incompatible with traditional constructs like dividend//*comment*/divisor. " |