> Le 10 févr. 2015 à 07:46, Paul Eggert <[email protected]> a écrit :
> 
> Ferdinand Thiessen wrote:
>> I use musl as libc and they use C.utf8
> 
> Yeowch.  What a pain.  As I understand it, this sort of behavior will be 
> prohibited in the next release of POSIX; see:
> 
> http://austingroupbugs.net/view.php?id=663
> 
> That being said, the Bison tests should be portable even to platforms like 
> musl, I suppose.  In the meantime you can work around the problem by using 
> some other C library.

Hi Paul, hi Ferdinand,

FWIW, the testsuite does enforce LC_ALL=C.

In the present case, I'm unsure about the suggested patch,
since it uses UTF-8, which might behave unexpected on other
platforms I guess.

So I'd rather go for something like the following patch:

commit 8b35712ae3e56e2f1094eb2afb29b0b4dacdb230
Author: Akim Demaille <[email protected]>
Date:   Tue Feb 10 11:12:56 2015 +0100

    tests: be robust to platforms that support UTF-8 even with LC_ALL=C
    
    Because musl supports UTF-8 with LC_ALL=C, gcc produces:
    
      input.y: In function ‘yyparse’:
    
    instead of:
    
      input.y: In function 'yyparse':
    
    Reported by Ferdinand Thiessen.
    http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00001.html
    
    * tests/synclines.at (AT_SYNCLINES_COMPILE): Skip syncline tests when
    we can't trust error messages issued about a function body.

diff --git a/THANKS b/THANKS
index 26bea0a..32fc67f 100644
--- a/THANKS
+++ b/THANKS
@@ -48,6 +48,7 @@ Enrico Scholz             
[email protected]
 Eric Blake                [email protected]
 Evgeny Stambulchik        [email protected]
 Fabrice Bauzac            [email protected]
+Ferdinand Thiessen        [email protected]
 Florian Krohm             [email protected]
 Frank Heckenbach          [email protected]
 Frans Englich             [email protected]
diff --git a/tests/synclines.at b/tests/synclines.at
index 00c2fc1..b73ddcb 100644
--- a/tests/synclines.at
+++ b/tests/synclines.at
@@ -136,12 +136,14 @@ EOF
 m4_define([AT_SYNCLINES_COMPILE],
 [# Check if we can trust location translation.
 AT_DATA([syncline.c],
-[[#error "1"
-int i; /* avoids -pedantic warning about an empty translation unit. */
+[[static void foo(void)
+{
+#error "3"
+}
 ]])
 
 _AT_SYNCLINES_COMPILE([syncline.c])
-AT_CHECK([[test "`cat stdout`" = 'syncline.c:1: @%:@error "1"' || exit 77]])
+AT_CHECK([[test "`cat stdout`" = 'syncline.c:3: @%:@error "3"' || exit 77]])
 
 # Then work for real.
 _AT_SYNCLINES_COMPILE([$1])



Reply via email to