summaryrefslogtreecommitdiff
path: root/gcc/genattrtab.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-29 18:26:31 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-29 18:26:31 +0000
commita962362e39411a26265d067b69c2413d91675daa (patch)
tree258e8a05f5a72c95add5de9327fa830b67989a30 /gcc/genattrtab.c
parentd7c7b23cc5b7bf308ef3a009b8414248c382f6ca (diff)
downloadgcc-a962362e39411a26265d067b69c2413d91675daa.tar.gz
* 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
Diffstat (limited to 'gcc/genattrtab.c')
-rw-r--r--gcc/genattrtab.c20
1 files changed, 6 insertions, 14 deletions
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));
}