autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: _AC_CHECK_TYPE_REPLACEMENT_TYPE_P


From: Akim Demaille
Subject: Re: _AC_CHECK_TYPE_REPLACEMENT_TYPE_P
Date: 23 Jun 2001 15:29:22 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor)

>>>>> "Paul" == Paul Eggert <address@hidden> writes:

Paul> So how about if we replace the regular expression with the
Paul> following instead:

Paul> 
^\(_Bool\|bool\|char\|double\|float\|int\|long\|short\|\(un\)?signed\|[_a-zA-Z][_a-zA-Z0-9]*_t\)\(\([(
Paul> *]\|\[\)\([_a-zA-Z0-9() *]\|\[\|\]\)*\)?$

I trust you Paul, please, go ahead, and apply the patch you think is
right.  Please, don't forget NEWS.

Paul> (By the way, is there some reason we can't rewrite
Paul> \([FOO]\|\[\|\]\) to [][FOO] in order to make these regexps
Paul> easier to read?  If that's not possible due to m4 bugs, perhaps
Paul> this problem should be documented.)

Hm, maybe it was my misunderstanding quotation.  There can be
interactions between the two [] (M4, and RE), and I remember I found
this solution.

But I don't recall what the problem was, and I really thought I had
documented it somewhere.  It seems to work fine though:

~/src/ace % cat /tmp/foo.m4                                      nostromo Err 1
changequote([, ])
define([test],
[[$1] => ifelse(regexp([$1], [[][FO]]), 0, yes, no)])

test([FO[]])
test([F])
test([S])
~/src/ace % m4 /tmp/foo.m4                                       nostromo 15:25



FO[] => yes
F => yes
S => no


Paul> If we go this route, we should also change the documentation
Paul> from this:

Paul> If the second argument is a C or C++ @emph{builtin} type, then
Paul> the obsolete version is used.  Because many people have used
Paul> @samp{off_t} and @samp{size_t} as replacement types, they are
Paul> recognized too.

Paul> to this:

Paul> If the second argument appears to be a C or C++ type, then the
Paul> obsolete version is used.  This happens if the argument is a C
Paul> or C++ @emph{builtin} type or a C identifier ending in
Paul> @samp{_t}, optionally followed by one of @samp{[(* } and then by
Paul> a string of zero or more characters taken from the set
Paul> @samp{[]()* _a-zA-Z0-9}.

Definitely!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]