This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch installed for traditional C compatibility in gengtype.c
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 30 Jun 2002 08:18:54 -0400 (EDT)
- Subject: Patch installed for traditional C compatibility in gengtype.c
This was necessary for traditional C compatibility, without this patch
the fixedargs go out of scope in K&R mode.
Tested on solaris2 using "gcc -traditional" (v2.95.2) and installed as
obvious.
2002-06-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gengtype.c (oprintf): Move VA_CLOSE after all fixedarg uses.
diff -rup orig/egcc-CVS20020629/gcc/gengtype.c egcc-CVS20020629/gcc/gengtype.c
--- orig/egcc-CVS20020629/gcc/gengtype.c 2002-06-20 13:13:14.000000000 -0400
+++ egcc-CVS20020629/gcc/gengtype.c 2002-06-30 07:57:05.440150384 -0400
@@ -586,7 +586,6 @@ oprintf VPARAMS ((outf_p o, const char *
VA_FIXEDARG (ap, outf_p, o);
VA_FIXEDARG (ap, const char *, format);
slength = xvasprintf (&s, format, ap);
- VA_CLOSE (ap);
if (o->bufused + slength > o->buflength)
{
@@ -602,6 +601,7 @@ oprintf VPARAMS ((outf_p o, const char *
memcpy (o->buf + o->bufused, s, slength);
o->bufused += slength;
free (s);
+ VA_CLOSE (ap);
}
/* Open the global header file and the language-specific header files. */