I would like to request on the next update of the ARM tools that a check box be added to allow "// style comments". This has been added to the C99 standard. This way, Stict ANSCI C can be checked along with checking "//" style comments.
Thanks, Barry Gordon ================================================== The following statement was copied from david.tribble.com/.../cdiffs.htm
Comments C++ recognizes //... comments as well as /*...*/ comments. C90 only recognizes the /*...*/ form of comments. The //... form usually produces a syntax error in C90, but there are rare cases that may compile erroneously without warning: i = (x//*y*/z++ , w); C99 recognizes both forms of comments. [C99: §5.1.1.2, 6.4.9] [C++98: §2.1, 2.7]
Reinhard Keil said:
"The RealView [ARM] Compiler is ANSI C99. All other Keil Compilers are C90 with some language extensions."
See: http://www.keil.com/forum/docs/thread8500.asp
C51 certainly does allow the "//" comment style
I think Barry is referring to:
Project -> Options for Target -> 'C/C++' Tab 'Stict ANSI C' checkbox.
checking this Checkbox adds the '--strict' command to the compiler command string at the bottom.
From the \Keil\ARM\Hlp\RV_cc.pdf manual, page 42 of the PDF (2-24 of the manual)
Enables strict ISO mode (ISO/IEC 9899:1990 (E)) and the C++ Standard (ISO/IEC 14882:1998 (E)). Diagnostic messages are returned when nonstandard features are used, and features that conflict with ISO C or C++ are disabled. This is compatible in both C and C++ mode.
I forgot to indicate the C/C++ tab in the original post. When strict is selected error #29 "expected an expression" is output on a line suct as
int myVar = 10; // C99 style comment
then warnings and errors are output for other lines following. I've seen other compilers that allow '// style comment" with '--strict' enabled by providing an additional checkbox.