"Steven G. Johnson" <[EMAIL PROTECTED]> writes: > Paul Eggert wrote: >> That could well be, but it was never documented and it's not clear >> to me what the semantics would be. Are arbitrary characters allowed >> in the macro name? Surely not. > > No, just things that are valid in cpp #defines.
Surely that's too strong as well. Are ellipses "..." allowed? How about C comments, Universal Character Names and UTF-8 in names? Or backslash-newline, which can occur between any two pairs of characters in the above? Or trigraphs lke "??=" and "??/"? These are all valid in cpp #defines, before the ")" that closes the argument list. This stuff can get hairy pretty quickly, which is why we'd need to document exactly what we support, if we want to support it. >> What happens if we have >> AC_DEFINE([NAME(x)], ...) followed by AC_DEFINE([NAME(y)], ...) >> followed by AC_DEFINE([NAME], ...)? > > The same thing that happens if you do AC_DEFINE([NAME],[VAL1]) > followed by AC_DEFINE([NAME],[VAL2]): the last definition encountered > is the one used. That actually worked, despite the change in spelling among [NAME(x)] and [NAME(y)] and [NAME]? That's news to me. But again, whatever the rule is, it should be documented. For example, what would happen if there's white space in the name, e.g., [NAME(x, y)] or [ NAME] or [NAME ]? > I think you're making it out to be more complicated than it is. Maybe. Perhaps it's because I've been burned by cpp too many times.... > In the @defmac AC_DEFINE, in autoconf.tex, all we need to do is to > add a single sentence, The sentence you proposed was a good start, but it doesn't answer the questions I raised above. Also, ideally I'd like a complete patch: not just the documentation change, but the .m4 change. That is, I'd rather not go back to the old way of doing things, where users could AC_DEFINE any string and then get into real trouble. I'd rather have Autoconf check that the string being defined is in the subset of strings actually supported by Autoconf. PS. Another question: is an empty argument list allowed? That wasn't clear to me either.
