This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: objc-exp.y compiler warnings
- From: Adam Fedor <fedor at doc dot com>
- To: GDB Patches <gdb-patches at sources dot redhat dot com>
- Date: Sat, 28 Dec 2002 19:23:56 -0700
- Subject: [PATCH]: objc-exp.y compiler warnings
A minor, obvious patch to quite compiler warnings.
2002-12-28 Adam Fedor <fedor@gnu.org>
* gdb/objc-exp.y (parse_number): Cast sscanf arguments to proper type.
(yylex): Initialize c to avoid uninitialized warning.
Index: objc-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/objc-exp.y,v
retrieving revision 1.7
diff -u -p -r1.7 objc-exp.y
--- objc-exp.y 19 Nov 2002 15:23:58 -0000 1.7
+++ objc-exp.y 29 Dec 2002 02:21:15 -0000
@@ -1022,9 +1022,9 @@ parse_number (p, len, parsed_float, puti
/* It's a float since it contains a point or an exponent. */
if (sizeof (putithere->typed_val_float.dval) <= sizeof (float))
- sscanf (p, "%g", &putithere->typed_val_float.dval);
+ sscanf (p, "%g", (float *)&putithere->typed_val_float.dval);
else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double))
- sscanf (p, "%lg", &putithere->typed_val_float.dval);
+ sscanf (p, "%lg", (double *)&putithere->typed_val_float.dval);
else
{
#ifdef PRINTF_HAS_LONG_DOUBLE
@@ -1277,6 +1277,7 @@ yylex ()
return tokentab2[i].token;
}
+ c = 0;
switch (tokchr = *tokstart)
{
case 0: