m4-patches
[Top][All Lists]
Advanced

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

FYI: kill warnings on head


From: Eric Blake
Subject: FYI: kill warnings on head
Date: Sat, 10 Jun 2006 07:41:11 -0600
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

These were the only things preventing a CFLAGS='-Wall -Werror' build to
complete, at least on cygwin with gcc 3.4.  Applied.

m4/macro.c: In function `trace_pre':
m4/macro.c:579: warning: conversion lacks type at end of format
m4/macro.c:579: warning: wchar_t format, different type arg (arg 3)
m4/macro.c:579: warning: unknown conversion type character `r' in format
m4/macro.c: In function `trace_post':
m4/macro.c:624: warning: conversion lacks type at end of format
m4/macro.c:624: warning: wchar_t format, different type arg (arg 3)
m4/macro.c:624: warning: unknown conversion type character `r' in format

src/main.c: In function `main':
src/main.c:252: warning: passing arg 2 of `rpl_getopt_long' discards
qualifiers from pointer target type

2006-06-10  Eric Blake  <address@hidden>

        Avoid compiler warnings.
        * m4/macro.c (trace_format): Don't mark this as a printf format,
        since we don't accept the same set of modifiers as printf.  It
        would be nice if gcc let us specify a custom format archetype.
        * src/main.c (main): Cast away const.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEisv284KuGfSFAYARAmHjAKCjIb+6PvABKkXHqe363wVYmTmUgQCfb507
H1/04n5ZH3cXYErfiHtxG+k=
=oXiM
-----END PGP SIGNATURE-----
Index: m4/macro.c
===================================================================
RCS file: /sources/m4/m4/m4/macro.c,v
retrieving revision 1.44
diff -u -p -r1.44 macro.c
--- m4/macro.c  1 May 2005 11:10:05 -0000       1.44
+++ m4/macro.c  10 Jun 2006 13:38:37 -0000
@@ -1,5 +1,5 @@
 /* GNU m4 -- A simple macro processor
-   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2001
+   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2001, 2006
    Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -44,8 +44,12 @@ static void    trace_pre      (m4 *context, 
                                  m4_symbol_value **);
 static void    trace_post       (m4 *context, const char *, int, int,
                                  m4_symbol_value **, const char *);
-static void    trace_format     (m4 *context, const char *fmt, ...)
-                                                       M4_GNUC_PRINTF(2, 3);
+
+/* It would be nice if we could use M4_GNUC_PRINTF(2, 3) on
+   trace_format, but since we don't accept the same set of modifiers,
+   it would lead to compiler warnings.  */
+static void    trace_format     (m4 *context, const char *fmt, ...);
+
 static void    trace_header     (m4 *, int);
 static void    trace_flush      (m4 *);
 
@@ -482,14 +486,14 @@ trace_format (m4 *context, const char *f
 
        case 'l':
          s = m4_is_debug_bit (context, M4_DEBUG_TRACE_QUOTE)
-               ? m4_get_syntax_lquote (M4SYNTAX)
-               : "";
+               ? m4_get_syntax_lquote (M4SYNTAX)
+               : "";
          break;
 
        case 'r':
          s = m4_is_debug_bit(context, M4_DEBUG_TRACE_QUOTE)
-               ? m4_get_syntax_rquote (M4SYNTAX)
-               : "";
+               ? m4_get_syntax_rquote (M4SYNTAX)
+               : "";
          break;
 
        case 'd':
Index: src/main.c
===================================================================
RCS file: /sources/m4/m4/src/main.c,v
retrieving revision 1.64
diff -u -p -r1.64 main.c
--- src/main.c  6 May 2005 08:30:52 -0000       1.64
+++ src/main.c  10 Jun 2006 13:38:37 -0000
@@ -1,6 +1,6 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 1999, 2000, 2003, 2004, 2005
+   Copyright (C) 1989-1994, 1999, 2000, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -249,7 +249,8 @@ main (int argc, char *const *argv, char 
 
   head = tail = NULL;
 
-  while (optchar = getopt_long (argc, argv, OPTSTRING, long_options, NULL),
+  while (optchar = getopt_long (argc, (char **) argv, OPTSTRING,
+                               long_options, NULL),
         optchar != EOF)
     switch (optchar)
       {

reply via email to

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