Akim Demaille writes:
> Just a note about changequote. Although you would certainly have
> problems with the characters [ and ] themselves, there is really no
> reason to use it when using patsubst. This is a very bad (IMHO) idiom
> which is spread by Autoconf itself.
>
> Just say no to
>
> changequote()
> patsubst($1, [^a-z])
> changequote([, ])
>
> but welcome
>
> patsubst([$1], [[^a-z]])
Ah! The outer [] are against m4, and the inner ones "[^a-z]" are the patsubst
argument, right? I had problems with this, indeed.
> Do you think there's will be other uses than AC_CHECK_SIZEOF?
1) AC_CHECK_ALIGNMENTOF using the following construction:
#define type ...
struct { char dummy1; type dummy2; } dummy;
#define expr ((char*)&dummy.dummy2 - (char*)&dummy)
(You might think this would be equivalent to
typedef struct { char dummy1; type dummy2; } dummy;
#define expr (int)(&((dummy *)0)->dummy2)
but wrong. The latter macro works only in C, not in C++, because C++
restricts the use of NULL pointers.)
2) AC_CHECK_TYPE_SIGNED using
#define expr ((expr)(-1) < (expr)0)
and anything else which involves types and casts.
Bruno