Amrnasr / lz4

Automatically exported from code.google.com/p/lz4
0 stars 0 forks source link

Use ansi style comments for portability #78

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
To be portable, you should use the ansi-style /* comments */
instead of the c99-style single-line // comments.

The latter style is only valid in c99 compatible compilers
https://en.wikipedia.org/wiki/C_syntax#Comments

Original issue reported on code.google.com by dif...@gmail.com on 17 Aug 2013 at 6:44

GoogleCodeExporter commented 8 years ago
Hello

We had this discussion already, with Maciej Adamczyk.
While it's correct that // comments are supposed to be C99,
in practice, all known compilers handle them.
Still looking for counter-examples.

The single-line comments // have been selected because they are both more 
convenient and improve readability.

Original comment by yann.col...@gmail.com on 17 Aug 2013 at 7:13

GoogleCodeExporter commented 8 years ago
The Sun Workshop compiler requires compiling with '-xCC' if your C code has C++ 
style comments:
http://docs.oracle.com/cd/E19957-01/805-4952/z400016b80ee/

Original comment by dif...@gmail.com on 17 Aug 2013 at 11:57

GoogleCodeExporter commented 8 years ago
Thanks for the link.
Hasn't Sun Workshop been upgraded to version 6 since then ?
The version 5 seems to be a bit older (released in 1999 if I do understand 
correctly).

Original comment by yann.col...@gmail.com on 18 Aug 2013 at 10:35

GoogleCodeExporter commented 8 years ago
Core readability takes precedence.

Original comment by yann.col...@gmail.com on 9 Sep 2013 at 9:12