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: Paul Eggert
Subject: Re: _AC_CHECK_TYPE_REPLACEMENT_TYPE_P
Date: Wed, 20 Jun 2001 10:13:14 -0700 (PDT)

> From: Andreas Schwab <address@hidden>
> Date: 19 Jun 2001 11:14:26 +0200
> 
> Akim Demaille <address@hidden> writes:
> |>                  
> [^\(_Bool\|bool\|char\|double\|float\|int\|long\|short\|\(un\)?signed\|size_t\|off_t\)\([_a-zA-Z0-9()
>  *]\|\[\|\]\)*$]),
> ...
> |> But Andreas, I guess you do have a warning, don't you?  What patch
> |> would you suggest?
> 
> I'd like to have the regex changed to
> 
> ^\(_Bool\|bool\|char\|double\|float\|int\|long\|short\|\(un\)?signed\|[_a-z0-9][_a-z0-9]*_t\)\([_a-zA-Z0-9()
>  *]\|\[\|\]\)*$

I see two problems here:

* Many old configure files rely on AC_CHECK_TYPES(..., foo_t),
  even though this was never documented to work.

* The autoconf 2.50 code does not match the documentation, as the
  code's regexp has a trailing \([_a-zA-Z0-9() *]\|\[\|\]\)*.  This
  can match strings that are not C or C++ builtin types.  It also
  happens to match the '8_t' in 'int8_t'.

I have been a bit of a hardliner on being strict here, but I'm
starting to think that Andreas is right: we should relax the regular
expression to allow *_t.  On the other hand, I think we should also
tighten the regular expression to not accept strings like
'mysql_convert_table_format', which is a valid shell command on my
host, and would be acceptable to Andreas's regexp.

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

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

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


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

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

to this:

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



reply via email to

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