From ec83eb53a7956e1948eeaf62b9d14babcdeda4af Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 29 Aug 2001 18:26:31 +0000 Subject: [PATCH] * genattrtab.c (attr_printf): Use VA_OPEN/VA_FIXEDARG/VA_CLOSE. From-SVN: r45274 --- gcc/ChangeLog | 4 ++++ gcc/genattrtab.c | 20 ++++++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3094a9e947b..9c1b07cba4d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2001-08-29 Kaveh R. Ghazi + + * genattrtab.c (attr_printf): Use VA_OPEN/VA_FIXEDARG/VA_CLOSE. + 2001-08-29 Kazu Hirata * config/h8300/h8300.md (movsi_h8300hs): Make it 64-bit safe. diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 2a7b7579c16..55d8adfced1 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -744,25 +744,17 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) char * attr_printf VPARAMS ((register int len, const char *fmt, ...)) { -#ifndef ANSI_PROTOTYPES - register int len; - const char *fmt; -#endif - va_list p; char str[256]; - VA_START (p, fmt); - -#ifndef ANSI_PROTOTYPES - len = va_arg (p, int); - fmt = va_arg (p, const char *); -#endif - - if (len > 255) /* leave room for \0 */ + VA_OPEN (p, fmt); + VA_FIXEDARG (p, int, len); + VA_FIXEDARG (p, const char *, fmt); + + if (len > (sizeof(str) - 1)) /* leave room for \0 */ abort (); vsprintf (str, fmt, p); - va_end (p); + VA_CLOSE (p); return attr_string (str, strlen (str)); }