Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: Say Yes to C++ style comments
Home

[Freeciv-Dev] Re: Say Yes to C++ style comments

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Say Yes to C++ style comments
From: Reinier Post <rp@xxxxxxxxxx>
Date: Fri, 30 Nov 2001 21:14:32 +0100

On Fri, Nov 30, 2001 at 12:13:03PM +0100, Daniel Sjölie wrote:
> On 2001-11-30 02:36:28, Raahul Kumar wrote:
> > 
> > --- Jules Bean <jules@xxxxxxxxxxxxxxx> wrote:
> > 
> > > 
> > > <pedant comment="sorry">
> > > 
> > > Yes it is.  The current C standard is "ISO/IEC 9899:1999 (E), as
> > > amended by ISO/IEC 9899:1999/Cor.1:2001 (E)", commonly known as 'C99'.
> > > 
> > > C99 includes // comments.
> > > 
> > > Sadly (nay, ridiculously!) the standards group don't *seem* to put the 
> > > standard online.  However, the GCC features table makes it clear
> > > enough what's in it..
> > > 
> > > http://gcc.gnu.org/c99status.html
> > > 
> > > </pedant>
> > 
> > I'd like a vote from the current developers and maintainers. Make using //
> > comments legal.
> 
> Does anyone have an example where freeciv is compiled with a compiler
> that cannot handle "//"??
> 
> If not I think we should allow it... Even if it might pose a problem for
> someone somewhere sometime in the future...

/tmp % cat << ZZ > comment.c
? int main(int argc, char argv[]) {}  // and a comment
? ZZ
/tmp % make comment
cc     comment.c   -o comment
"comment.c", line 1: syntax error before or at: /
"comment.c", line 1: undefined or not a type: and
"comment.c", line 1: cannot recover from previous errors
cc: acomp failed for comment.c
make: *** [comment] Error 2
/tmp % make CC=gcc comment
gcc     comment.c   -o comment
/tmp % rm comment
/tmp % make CFLAGS=-xCC comment
cc -xCC    comment.c   -o comment

cc is Sun's commercial compiler.  I suppose it would be good enough to add
adding a test for this compiler (e.g. use this:

/tmp % cc -V
cc: WorkShop Compilers 5.0 98/12/15 C 5.0

) and add the -xCC flag if the test succeeds.

-- 
Reinier


[Prev in Thread] Current Thread [Next in Thread]