|
From: <sv...@va...> - 2005-10-14 13:49:01
|
Author: njn
Date: 2005-10-14 14:48:54 +0100 (Fri, 14 Oct 2005)
New Revision: 4921
Log:
Avoid two compiler warnings.
Modified:
trunk/coregrind/m_debuginfo/symtypes.c
Modified: trunk/coregrind/m_debuginfo/symtypes.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/symtypes.c 2005-10-14 11:25:49 UTC (rev 4=
920)
+++ trunk/coregrind/m_debuginfo/symtypes.c 2005-10-14 13:48:54 UTC (rev 4=
921)
@@ -760,7 +760,9 @@
Bool keep =3D False;
=20
/* Add a new variable to the list */
- void newvar(Char *name, SymType *ty, Addr valuep, UInt size) {
+ // (the declaration avoids a compiler warning)
+ static void newvar(Char *name, SymType *ty, Addr valuep, UInt size);
+ void newvar(Char *name, SymType *ty, Addr valuep, UInt size) {
Variable *v;
=20
/* have we been here before? */
@@ -980,7 +982,8 @@
Char expr[len*2];
Char *sp =3D &expr[len]; /* pointer at start of string */
Char *ep =3D sp; /* pointer at end of string */
- void genstring(Variable *v, Variable *inner) {
+ static void genstring(Variable *v, Variable *inner); // avoid warning
+ void genstring(Variable *v, Variable *inner) {
Variable *c =3D v->container;
=20
if (c !=3D NULL)
|
|
From: Tom H. <to...@co...> - 2005-10-14 16:08:25
|
In message <200...@ja...>
sv...@va... wrote:
> Modified: trunk/coregrind/m_debuginfo/symtypes.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- trunk/coregrind/m_debuginfo/symtypes.c 2005-10-14 11:25:49 UTC (rev 4=
920)
> +++ trunk/coregrind/m_debuginfo/symtypes.c 2005-10-14 13:48:54 UTC (rev 4=
921)
> @@ -760,7 +760,9 @@
> Bool keep =3D False;
>=20=20
> /* Add a new variable to the list */
> - void newvar(Char *name, SymType *ty, Addr valuep, UInt size) {
> + // (the declaration avoids a compiler warning)
> + static void newvar(Char *name, SymType *ty, Addr valuep, UInt size);
> + void newvar(Char *name, SymType *ty, Addr valuep, UInt size) {
> Variable *v;
>=20=20
> /* have we been here before? */
> @@ -980,7 +982,8 @@
> Char expr[len*2];
> Char *sp =3D &expr[len]; /* pointer at start of string */
> Char *ep =3D sp; /* pointer at end of string */
> - void genstring(Variable *v, Variable *inner) {
> + static void genstring(Variable *v, Variable *inner); // avoid warning
> + void genstring(Variable *v, Variable *inner) {
> Variable *c =3D v->container;
>=20=20
> if (c !=3D NULL)
Unfortunately this breaks with gcc 4 it seems:
m_debuginfo/symtypes.c: In function =A1=C6vgPlain_describe_addr=A1=C7:
m_debuginfo/symtypes.c:764: error: invalid storage class for function =A1=
=C6newvar=A1=C7
m_debuginfo/symtypes.c:765: warning: no previous prototype for =A1=C6newvar=
=A1=C7
m_debuginfo/symtypes.c:985: error: invalid storage class for function =A1=
=C6genstring=A1=C7
m_debuginfo/symtypes.c:986: warning: no previous prototype for =A1=C6genstr=
ing=A1=C7
When did those nested functions creep back in anyway... I thought we
had got rid of them all.
Tom
--=20
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Nicholas N. <nj...@cs...> - 2005-10-14 16:30:07
|
On Fri, 14 Oct 2005, Tom Hughes wrote: > Unfortunately this breaks with gcc 4 it seems: > > m_debuginfo/symtypes.c: In function =A1=C6vgPlain_describe_addr=A1=C7: > m_debuginfo/symtypes.c:764: error: invalid storage class for function =A1= =C6newvar=A1=C7 > m_debuginfo/symtypes.c:765: warning: no previous prototype for =A1=C6newv= ar=A1=C7 > m_debuginfo/symtypes.c:985: error: invalid storage class for function =A1= =C6genstring=A1=C7 > m_debuginfo/symtypes.c:986: warning: no previous prototype for =A1=C6gens= tring=A1=C7 Damn, I knew there was a reason why this didn't work last time I tried... > When did those nested functions creep back in anyway... I thought we > had got rid of them all. I think those ones have been there for a long time; I tried un-nesting=20 them once but they're really nasty and I gave up. They're never executed= =20 currently because they are in the symtype code which only Helgrind uses. Nick |
|
From: Julian S. <js...@ac...> - 2005-10-14 16:39:38
|
> > When did those nested functions creep back in anyway... I thought we > > had got rid of them all. > > I think those ones have been there for a long time; I tried un-nesting > them once but they're really nasty and I gave up. They're never executed > currently because they are in the symtype code which only Helgrind uses. Maybe we should #if 0 that stuff until such time as Helgrind is reinstated? J |