[Bug preprocessor/39603] New: Incorrect "C++ style comments" error

terra at gnome dot org gcc-bugzilla@gcc.gnu.org
Tue Mar 31 20:01:00 GMT 2009


It's perfectly fine to have "//" in code that the compiler never sees
because the pre-processor kills it.  gcc should not warn or err because
of it.


#if 0
// howdy
#endif

int main () { return 0; }


/usr/bin/gcc -v -pedantic-errors -c xxx.c
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --with-local-prefix=/usr/local
--infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64
--libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3
--enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --with-slibdir=/lib64
--with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new
--disable-libstdcxx-pch --program-suffix=-4.3
--enable-version-specific-runtime-libs --enable-linux-futex
--without-system-libunwind --with-cpu=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE
Linux) 
COLLECT_GCC_OPTIONS='-v' '-pedantic-errors' '-c' '-mtune=generic'
 /usr/lib64/gcc/x86_64-suse-linux/4.3/cc1 -quiet -v xxx.c -quiet -dumpbase
xxx.c -mtune=generic -auxbase xxx -pedantic-errors -version -o /tmp/cc9TX25S.s
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib64/gcc/x86_64-suse-linux/4.3/include
 /usr/lib64/gcc/x86_64-suse-linux/4.3/include-fixed
 /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/include
 /usr/include
End of search list.
GNU C (SUSE Linux) version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision
135036] (x86_64-suse-linux)
        compiled by GNU C version 4.3.1 20080507 (prerelease) [gcc-4_3-branch
revision 135036], GMP version 4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 90a9e1b04e08ceaf9359eb36b95ad09d
xxx.c:2:1: error: C++ style comments are not allowed in ISO C90
xxx.c:2:1: error: (this will be reported only once per input file)


-- 
           Summary: Incorrect "C++ style comments" error
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: terra at gnome dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39603



More information about the Gcc-bugs mailing list