From a962362e39411a26265d067b69c2413d91675daa Mon Sep 17 00:00:00 2001 From: ghazi Date: Wed, 29 Aug 2001 18:26:31 +0000 Subject: [PATCH] * genattrtab.c (attr_printf): Use VA_OPEN/VA_FIXEDARG/VA_CLOSE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45274 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/genattrtab.c | 20 ++++++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3094a9e..9c1b07c 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 2a7b757..55d8adf 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)); } -- 2.7.4