bison-patches
[Top][All Lists]
Advanced

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

avoid compiler warnings


From: Eric Blake
Subject: avoid compiler warnings
Date: Mon, 29 Jun 2009 14:38:21 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

I'm now getting this:

In file included from src/scan-code-c.c:3:
scan-code.l: In function `parse_named_ref':
scan-code.l:538: warning: int format, long int arg (arg 4)
scan-code.l:592: warning: char format, void arg (arg 3)

I'm not sure why the messages are off by one (the lines I touched were 537 and 
591); maybe the #line directive generation needs to be investigated?

Also, I'm seeing a spurious diff on parse-gram.c which points to compilation 
with a user-specific setup; any reason this generated file is still kept under 
version control?

 /* Line 191 of yacc.c  */
-#line 154 "/Users/akim/src/kernel/bison/src/parse-gram.c"
+#line 154 "src/parse-gram.c"

OK to apply this patch?  I only tested the master branch, might it also be 
needed on other branches?


From: Eric Blake <address@hidden>
Date: Mon, 29 Jun 2009 08:34:21 -0600
Subject: [PATCH] scan-code: avoid compiler warnings

* src/scan-code.l (parse_named_ref): Use correct specifiers.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog       |    5 +++++
 src/scan-code.l |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bc97136..df07483 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-29  Eric Blake  <address@hidden>
+
+       scan-code: avoid compiler warnings
+       * src/scan-code.l (parse_named_ref): Use correct specifiers.
+
 2009-06-29  Akim Demaille  <address@hidden>

        build: avoid concurrent extraction of calc++.
diff --git a/src/scan-code.l b/src/scan-code.l
index 4c91fd1..28a9fe4 100644
--- a/src/scan-code.l
+++ b/src/scan-code.l
@@ -534,7 +534,7 @@ parse_named_ref(char *cp, symbol_list *rule, int 
rule_length,
       if (variant->ind == 0)
        strcpy(at_buf, "$$");
       else
-       snprintf(at_buf, sizeof(at_buf), "$%d", variant->ind);
+       snprintf(at_buf, sizeof(at_buf), "$%ld", variant->ind);

       if (variant->err == 0)
        complain_at (variant->loc, _("  refers to: %c%s at %s"),
@@ -588,7 +588,7 @@ parse_named_ref(char *cp, symbol_list *rule, int 
rule_length,
                            "mid-rule action at $%d", midrule_rhs_index);

          obstack_1grow (&msg_buf, '\0');
-         complain_at (loc, _("%s"), obstack_finish (&msg_buf));
+         complain_at (loc, _("%s"), (char *) obstack_finish (&msg_buf));
          obstack_free (&msg_buf, 0);
        }
     }
-- 
1.6.3.2







reply via email to

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