diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-03-20 14:27:17 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-03-20 14:27:17 +0000 |
commit | 5bb9ff1ee56d2b5e75e01a7f066d8b0cec84ec02 (patch) | |
tree | 66e860a5099bcad013f1cf667255dc372a7c11b3 /dev-haskell/gtk2hs-buildtools/files | |
parent | 7218e1b46bceac05841e90472501742d905fb3fc (diff) |
gentoo resync : 20.03.2021
Diffstat (limited to 'dev-haskell/gtk2hs-buildtools/files')
-rw-r--r-- | dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.8.0-gcc-11.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.8.0-gcc-11.patch b/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.8.0-gcc-11.patch new file mode 100644 index 000000000000..123c1359ff1b --- /dev/null +++ b/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.8.0-gcc-11.patch @@ -0,0 +1,32 @@ +Same fix as https://github.com/visq/language-c/issues/74 + +""" +Lexer: allow zeros as line numbers in preprocessed directives + +Starting from `gcc-11` initial line numbers not related to +actual files are marked as zeros. See the "preprocessor: +Better line info for <builtin> & <command-line>" +https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=6bf2ff0d52a9 + +language-c's grammar did not allow it (by accident) + +``` +Prelude> Language.C.parseC (Data.ByteString.Char8.pack "# 0 \"/dev/null\"\n") Language.C.nopos +Left <no file>:: [ERROR] >>> Syntax Error ! + Lexical error ! + The character '#' does not fit here. +``` + +The change allows '0' in line numbers as well. +""" +--- a/c2hs/c/CLexer.x ++++ b/c2hs/c/CLexer.x +@@ -130,7 +130,7 @@ $white+ ; + -- * allows further ints after the file name a la GCC; as the GCC CPP docu + -- doesn't say how many ints there can be, we allow an unbound number + -- +-\#$space*@int$space*(\"($infname|@charesc)*\"$space*)?(@int$space*)*$eol ++\#$space*@digits$space*(\"($infname|@charesc)*\"$space*)?(@int$space*)*$eol + { \pos len str -> setPos (adjustPos (take len str) pos) >> lexToken } + + -- #pragma directive (K&R A12.8) |