OS: Fedora Core 4 (linux 2.6.14)

output of gcc -v:
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--host=i386-redhat-linux
Thread model: posix
gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)

Save the following as example.cc, compile with "g++ example.cc"

====== Cut here
extern "C"
{

#pragma pack(1)  /* Start comment
                    end comment on next line */
}

int main(int argc, char *argv[])
{
     return 0;
}
===== cut

I get "example.cc:1: error: unterminated comment"

When using "-save-temps" or "-E", it doesn't report any error.

I silenced this by ending the comment on the same line as #pragma.


-- 
           Summary: Bogus "unterminated comment" error from #pragma comment
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rich at kastle dot com


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

Reply via email to