[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Handles several --enable-gcc-warnings
From: |
Joel E. Denny |
Subject: |
Re: [PATCH] Handles several --enable-gcc-warnings |
Date: |
Mon, 17 Nov 2008 10:42:04 -0500 (EST) |
On Mon, 17 Nov 2008, Akim Demaille wrote:
> > I also get a warning for value = "" but the string pointed to is not changed
> > beyond that point. The code doesn't seen wrong, so I didn't try to ``fix''
> > it.
> >
> > src/getargs.c: In function `getargs':
> > src/getargs.c:535: warning: assignment discards qualifiers from pointer
> > target type
I pushed the following to master to fix it, so we can now configure with
--enable-gcc-warnings again. Thanks for taking care of the rest.
> Looks good. I think you should apply it in 2.4.1.
The branch-2.4.1 build already succeeds with --enable-gcc-warnings. I
always configure with that option because I find these warnings helpful.
I hope we'll continue to keep them working.
>From a8beef7e6a9f6b75fa249d59b4c79585190540b6 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Mon, 17 Nov 2008 10:36:28 -0500
Subject: [PATCH] Fix last warning from --enable-gcc-warnings.
* src/getargs.c (getargs): Don't assign const address to non-const
pointer.
diff --git a/src/getargs.c b/src/getargs.c
index 6b748c8..bc1cc64 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -529,11 +529,14 @@ getargs (int argc, char *argv[])
{
char* name = optarg;
char* value = strchr (optarg, '=');
+ char const * muscle_value = "";
if (value)
- *value++ = 0;
- else
- value = "";
- muscle_percent_define_insert (name, command_line_location (), value);
+ {
+ *value++ = 0;
+ muscle_value = value;
+ }
+ muscle_percent_define_insert (name, command_line_location (),
+ muscle_value);
}
break;
--
1.5.4.3