http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55163
Bug #: 55163 Summary: Ongoing problem with gengtype-lex.c under CygWin with CRLF text mode line endings since 4.8 Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap AssignedTo: unassig...@gcc.gnu.org ReportedBy: n...@josuttis.de For all versions of 4.8.0 I tried to compile, I run into the same problem when building a C++ compiler in my CygWin environment. The error is as follows: ======================== flex -ogengtype-lex.c ../../src/gcc/gengtype-lex.l && { \ echo '#include "bconfig.h"' > gengtype-lex.c.tmp; \ cat gengtype-lex.c >> gengtype-lex.c.tmp; \ mv gengtype-lex.c.tmp gengtype-lex.c; \ } g++ -c -g -O2 -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -fno-common -Wno-error -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../src/gcc -I../../src/gcc/build -I../../src/gcc/../include -I../../src/gcc/../libcpp/include -I/cygdrive/p/gcc/gcc-trunk-install/build/./gmp -I/cygdrive/p/gcc/gcc-trunk-install/src/gmp -I/cygdrive/p/gcc/gcc-trunk-install/build/./mpfr -I/cygdrive/p/gcc/gcc-trunk-install/src/mpfr -I/cygdrive/p/gcc/gcc-trunk-install/src/mpc/src -I../../src/gcc/../libdecnumber -I../../src/gcc/../libdecnumber/bid -I../libdecnumber -I../../src/gcc/../libbacktrace \ -o build/gengtype-lex.o gengtype-lex.c gengtype-lex.c:332: error: expected unqualified-id before "do" gengtype-lex.c:332: error: expected `,' or `;' before "do" gengtype-lex.c:352: error: expected unqualified-id before "while" gengtype-lex.c:352: error: expected `,' or `;' before "while" gengtype-lex.c:394: error: `yy_size_t' does not name a type gengtype-lex.c:524: error: expected unqualified-id before '?' token ... It seems that there is a CR/LF problem because I can fix it by running /usr/bin/sed -e 's/^M$//' on the generated gengtype-lex.c and then continue with the build. It looks like my CygWin settings let gengtype-lex.c get created with some CR/LF combinations, which the compiler is then not able to handle. This is probably caused by having DOS/text default file system type: $ mount -m none /cygdrive cygdrive text,posix=0,user 0 0 However, as I might not be the only one having text mode (with CRLF generated) as default, we should better fix this problem. Note that with gcc 4.7.x this problem does not exist, so this problem is new with 4.8.