bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printf returns a signed int


From: Akim Demaille
Subject: printf returns a signed int
Date: Mon, 22 Oct 2018 17:33:03 +0200

commit 59ea9f88151e424eb877f50a97e13eeff9322f32
Author: Akim Demaille <address@hidden>
Date:   Mon Oct 22 14:24:56 2018 +0200

    printf returns a signed int
    
    * tests/local.at: Adjust location_print's signature.

diff --git a/data/c.m4 b/data/c.m4
index b8d09621..2ec6ceea 100644
--- a/data/c.m4
+++ b/data/c.m4
@@ -815,11 +815,11 @@ m4_define([b4_yy_location_print_define],
 
 YY_ATTRIBUTE_UNUSED
 ]b4_function_define([yy_location_print_],
-    [static unsigned],
+    [static int],
                [[FILE *yyo],                    [yyo]],
                [[YYLTYPE const * const yylocp], [yylocp]])[
 {
-  unsigned res = 0;
+  int res = 0;
   int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
   if (0 <= yylocp->first_line)
     {
diff --git a/tests/local.at b/tests/local.at
index 6fbaaa91..7ab7dbfc 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -470,7 +470,7 @@ m4_define([AT_YYERROR_DECLARE(c)],
 [#include <stdio.h>
 ]AT_LOCATION_IF([[
 #if defined ]AT_YYLTYPE[_IS_TRIVIAL && ]AT_YYLTYPE[_IS_TRIVIAL
-static unsigned location_print (FILE *yyo, ]AT_YYLTYPE[ const * const yylocp);
+static int location_print (FILE *yyo, ]AT_YYLTYPE[ const * const yylocp);
 # ifndef LOCATION_PRINT
 #  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
 # endif
@@ -485,10 +485,10 @@ m4_define([AT_YYERROR_DEFINE(c)],
 # if defined ]AT_YYLTYPE[_IS_TRIVIAL && ]AT_YYLTYPE[_IS_TRIVIAL
 /* Print *YYLOCP on YYO. */
 __attribute__((__unused__))
-static unsigned
+static int
 location_print (FILE *yyo, ]AT_YYLTYPE[ const * const yylocp)
 {
-  unsigned res = 0;
+  int res = 0;
   int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
   if (0 <= yylocp->first_line)
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]