diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-05-07 01:33:16 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-05-07 01:33:16 +0100 |
commit | c8fd0d84af0bfd1949542adc2cbb735b1d28f9ed (patch) | |
tree | 3ee550255947da075650f1a551dcc278f9a1b7f8 /dev-haskell/language-c/files/language-c-0.8.3-gcc-11.patch | |
parent | a978c074e4272bb901fbe4a10de0a7b2af574f17 (diff) |
gentoo resync : 07.05.2021
Diffstat (limited to 'dev-haskell/language-c/files/language-c-0.8.3-gcc-11.patch')
-rw-r--r-- | dev-haskell/language-c/files/language-c-0.8.3-gcc-11.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/dev-haskell/language-c/files/language-c-0.8.3-gcc-11.patch b/dev-haskell/language-c/files/language-c-0.8.3-gcc-11.patch new file mode 100644 index 000000000000..5b2e8e4e899c --- /dev/null +++ b/dev-haskell/language-c/files/language-c-0.8.3-gcc-11.patch @@ -0,0 +1,41 @@ +From 8133e1526750ab74ca4d5180fb140a7e172d473f Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <slyfox@gentoo.org> +Date: Sat, 8 Aug 2020 23:43:12 +0100 +Subject: [PATCH] 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. + +Closes: https://github.com/visq/language-c/issues/74 +Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> +--- + src/Language/C/Parser/Lexer.x | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/Language/C/Parser/Lexer.x ++++ b/src/Language/C/Parser/Lexer.x +@@ -147,7 +147,7 @@ $white+ ; + -- + -- * see https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html + -- +-\#$space*@int$space*(\"($infname|@charesc)*\"$space*)?(@int$space*)*\r?$eol ++\#$space*@digits$space*(\"($infname|@charesc)*\"$space*)?(@int$space*)*\r?$eol + { \pos len str -> setPos (adjustLineDirective len (takeChars len str) pos) >> lexToken' False } + + -- #pragma directive (K&R A12.8) +-- +2.28.0 + |