9 /* win32/C89 has no va_copy function... so we have to use the stupid fixed-length version */
10 int obstack_vprintf(struct obstack *obst, const char *fmt, va_list ap) FIRM_NOTHROW
13 int len = _vsnprintf(buf, sizeof(buf), fmt, ap);
14 obstack_grow(obst, buf, len);
18 int obstack_vprintf(struct obstack *obst, const char *fmt, va_list ap) FIRM_NOTHROW
22 size_t size = sizeof(buf);
28 len = vsnprintf(buffer, size, fmt, tap);
30 /* snprintf should return -1 only in the error case, but older glibcs
31 * and probably other systems are buggy in this respect and return -1 if
32 * the buffer was too small. We only abort for LARGE unrealistic buffer
40 } else if ((size_t)len >= size) {
41 /* If we come here more than once, vsnprintf() returned garbage */
42 assert(buffer == buf);
43 size = (size_t)len + 1;
47 buffer = (char*)malloc(size);
50 obstack_grow(obst, buffer, len);
58 int obstack_printf(struct obstack *obst, const char *fmt, ...) FIRM_NOTHROW
64 res = obstack_vprintf(obst, fmt, ap);