]> git.ipfire.org Git - thirdparty/gcc.git/commit
libcpp: decode original directory strings for traditional CPP
authorPierre Marie de Rodat <derodat@adacore.com>
Mon, 13 Oct 2025 22:11:37 +0000 (00:11 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 13 Oct 2025 22:24:19 +0000 (00:24 +0200)
commitbe496fd2aa528b4acc2002c04b7186a1f54b95e2
tree9598a7ad2a26d700c4b0928d4d1aebe720b81739
parent304d7359a67b8f7b979bf5941c7a5cbabf1aebcf
libcpp: decode original directory strings for traditional CPP

In traditional CPP mode (-save-temps, -no-integrated-cpp, etc.), the
compilation directory is conveyed to cc1 using a line such as:

 # <line> "/path/name//"

This string literal can contain escape sequences, for instance, if the
original source file was compiled in "/tmp/a\b", then this line will be:

 # <line> "/tmp/a\\b//"

So reading the compilation directory must decode escape sequences. This
last part is currently missing and this patch implements it.

libcpp/
* init.cc (read_original_directory): Attempt to decode escape
sequences with cpp_interpret_string_notranslate.
libcpp/init.cc