From 8f0ea644dddfaf9c41718ff055f4b77f0b8f43ad Mon Sep 17 00:00:00 2001 From: Greg King Date: Wed, 1 Mar 2017 06:36:25 -0500 Subject: [PATCH] Fixed a pointer-difference, comparison-with-zero expression. Some GCC C compilers can't subtract higher pointers from lower pointers properly, when those pointers must be scaled (because they point to objects that are wider than a char). The scaling is done as unsigned which makes the difference positive instead of negative. So, a broken expression was changed into a direct comparison between the two pointers. --- test/ref/yacc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ref/yacc.c b/test/ref/yacc.c index 5768f80d0..d0b9190e4 100644 --- a/test/ref/yacc.c +++ b/test/ref/yacc.c @@ -562,7 +562,7 @@ yylook() } # ifdef LEXDEBUG - if((*(lsp-1)-yysvec-1)<0) + if (*(lsp-1) < yysvec + 1) { fprintf(yyout,"yylook: stopped (end)\n"); }