delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/24/11:12:58

Date: Tue, 24 Jul 2001 17:11:25 +0200 (MET DST)
From: Gisle Vanem <giva AT bgnett DOT no>
To: djgpp AT delorie DOT com
Subject: gcc 3.0 preprocessor bug?
Message-ID: <Pine.UW2.3.95.1010724171031.1375A-100000@bryggen.bgnett.no>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019