[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [3.0.4] %printer/%destructor: simple backslashes in paths of #line s
From: |
Akim Demaille |
Subject: |
Re: [3.0.4] %printer/%destructor: simple backslashes in paths of #line statements not escaped |
Date: |
Sat, 18 Aug 2018 11:12:25 +0200 |
> Le 18 août 2018 à 10:06, Akim Demaille <address@hidden> a écrit :
>
> commit adf0425d11fcb60a8171b1c004f1c013789d3a96
> Author: Akim Demaille <address@hidden>
> 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).