From: Greg King Date: Wed, 1 Mar 2017 11:36:25 +0000 (-0500) Subject: Fixed a pointer-difference, comparison-with-zero expression. X-Git-Tag: V2.16~37^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F391%2Fhead;p=cc65 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. --- 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"); }