it seems with -pedantic flag part of CFLAGS makes
gcc spit the following errors:
warning: C++ style comments are not allowed in ISO C90
so what types of comments are allowed if i cannot use: // or /* */ style comments?
it seems with -pedantic flag part of CFLAGS makes
gcc spit the following errors:
warning: C++ style comments are not allowed in ISO C90
so what types of comments are allowed if i cannot use: // or /* */ style comments?
Huh? These /* */ are valid C comment delimiters.
C++ style comments not allowed refers to // not the /* */ pair
created small test project ...
// generates warning
but
/* does not */
very interesting...
i wonder if -pedantic is worth the effort... seems i only get these warning in my project but nothing useful.
of course its worth the effort to use pedantic
just use
-std=c++98 or similar
Last edited by monkeyking; June 19th, 2009 at 11:47 AM.
Running 8.10 on a lenovo 3000 n200!
Fingerprint reader doesn't work.
Let's do some history
The // comments were created at BCPL, but during the development of its successor B, these were dropped in favor of /* */... and these were inherited by B's successor, C.
C++ decided to resurrected the BCPL-style comment, along with the C-style ones. Of course, these proved to be very handy for short comments and C compilers began to accept them as a non-standard feature. gcc, when using the default GNU89 "standard", will accept them... The issue is that -pedantic will switch compilation to ISO C90.
The newest C standard is C99 and accepts the BCPL/C++-style comments. Use -std=c99 and it should work, even with -pedantic.
Bookmarks