> Le 18 août 2018 à 10:06, Akim Demaille <[email protected]> a écrit : > > commit adf0425d11fcb60a8171b1c004f1c013789d3a96 > Author: Akim Demaille <[email protected]> > Date: Sat Aug 18 09:59:48 2018 +0200 > > escape properly the file names in #line for printer/destructor > > Reported by Jannick. > http://lists.gnu.org/archive/html/bug-bison/2017-05/msg00001.html > > "Amusingly" enough, we have the same problem with %defines when the > parser file name has backslashes or quotes: we generate #includes with > an incorrect C string.
Well, there is nothing we can do about it, that’s in the syntax of the language: backslashes are not interpreted in #include, so they must not be escaped, and double-quotes, well, can’t be escaped, so must not be used. See https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html#Include-Syntax for instance. This is different from #line, which is explicitly a C string (see https://gcc.gnu.org/onlinedocs/cpp/Line-Control.html#Line-Control).
