Mail Archives: djgpp/2001/07/24/11:12:58
The following makefile demonstrates strange behaviour of the
preprocessor in gcc 3.0 (cpp0.exe dated 22 June 2001).
TEXT = "/* comment */\n" \
".text\n" \
"ret"
all:
$(DJDIR)/bin/echo $(TEXT) | gcc -E -
The output is:
e:/djgpp/bin/echo "/* comment */\n" ".text\n" "ret" | gcc -E -
cpp0.exe: warning: is shorter than expected
# 1 "<stdin>"
# 1 "e:/djgpp/lib/gcc-lib/djgpp/3.0/djgpp.ver" 1
# 1 "e:/djgpp/include/sys/version.h" 1 3
# 2 "e:/djgpp/lib/gcc-lib/djgpp/3.0/djgpp.ver" 2
# 2 "<stdin>" 2
.text
ret
t
Note the last 't'. Changing "ret" to "ret\n" removes the last 't',
but the cpp warning is still printed.
Gisle V.
- Raw text -