[Bug preprocessor/51259] New: no escape on control characters on linemarker lines

pertusus at free dot fr gcc-bugzilla@gcc.gnu.org
Mon Nov 21 21:57:00 GMT 2011


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

             Bug #: 51259
           Summary: no escape on control characters on linemarker lines
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pertusus@free.fr


In the cpp manual, node 'Preprocessor Output' it is told about linemarker lines

  They mean that the following line originated in file filename at line
linenum. filename will never contain any non-printing characters; they are
replaced with octal escape sequences. 

This is not what the following test shows (\x01 is also often denoted as C^A):

echo "int main() { }" > aa`printf '\x01'`bb.h
echo '#include "aa'`printf '\x01'`'bb.h"' > inc.c

And look at
cpp inc.c

or
gcc -E inc.c

gcc compiles the file inc.c fine.

I have no idea whether cpp should conform to the documentation or whether the
documentation should be changed...


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.6/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.2-4'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc
--enable-targets=all --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.6.2 (Debian 4.6.2-4)



More information about the Gcc-bugs mailing list