Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - C style comments cause problem
While trying to make one of my old programs ANSI-C compatible, especially the comments, I came across a problem. I have reduced the problem code to a few lines. The compiler barfs on the following comments in the source code: #include <stdio.h> /* db 6 dup (0) == 00 00 00 00 00 00 */ int main() { printf("Hello world.\n"); return 0; } C:\DEV>sc sctest.c sctest.c(9) : Lexical error: end of file found before end of comment, line 1 Fatal error: premature end of source file --- errorlevel 1 I get this same error message from SC 6.1, SC 7.22, and DMC 8.40 I tried several compilers from Borland, MicroSoft, Watcom, LCC etc., and all of them compile/run this code OK. Is it something wrong with the source or is it due to the SC/DMC compiler? Jan 19 2005
I can't reproduce the error with the example given. Is it possible you have an embedded zero or ^Z (0x1A) character inside the comment? "SSingh" <SSingh_member pathlink.com> wrote in message news:csmiun$emo$1 digitaldaemon.com...While trying to make one of my old programs ANSI-C compatible, especially Jan 19 2005
In article <csn5bk$157d$4 digitaldaemon.com>, Walter says...I can't reproduce the error with the example given. Is it possible you have an embedded zero or ^Z (0x1A) character inside the comment? Jan 20 2005
"SSingh" <SSingh_member pathlink.com> wrote in message news:csohr3$2vr5$1 digitaldaemon.com...In article <csn5bk$157d$4 digitaldaemon.com>, Walter says...Is it possible you have an embedded zero or ^Z (0x1A) character inside Jan 20 2005
|