I think m4_shipout_int is broken:
void
m4_shipout_int (struct obstack *obs, int val)
{
char buf[128];
sprintf(buf, "%d", val);
obstack_grow (obs, buf, strlen (buf));
}
because it does not include the possibility to quote the result.
Up to now, we didn't care much, but now that the alphabets can be changed,
I think it ought to quote its result. In fact, I'm tempted to make it
just like
void
m4_shipout_string (struct obstack *obs, const char *s, int len,
boolean quoted)
{
if (s == NULL)
s = "";
if (len == 0)
len = strlen(s);
if (quoted)
obstack_grow (obs, lquote.string, lquote.length);
obstack_grow (obs, s, len);
if (quoted)
obstack_grow (obs, rquote.string, rquote.length);
}
and in fact, I'm also tempted by replacing it with something based
on ntoa/numb_obstack as can be found in modules/m4.c. I guess there
would be some loss of performance, but then, if you consider it's
too expansive, anyway I would really like to see some m4_shipout_bigint
somewhere: I already use it in some of my modules, and it results in
a lot of code duplication. That would garantee some common flavor to
all these macros.
?
_______________________________________________
Bug-m4 mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-m4