autoconf
[Top][All Lists]
Advanced

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

Re: Reverse AC_CHECK_TYPE changes?


From: Akim Demaille
Subject: Re: Reverse AC_CHECK_TYPE changes?
Date: 04 Aug 2001 16:51:07 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor)

>>>>> "Adam" == Adam J Richter <address@hidden> writes:

Adam> 2. New AC_CHECK_TYPE format.

Adam> In practice, programs use many more "fallback" type names as the
Adam> second parameter to AC_CHECK_TYPE, which the new code fails to
Adam> detect.  The "old" format also make for much more readable
Adam> configure.in files.

>> But it's dead broken.  The right means to replace a type is using
>> typedef.  You ought to have a system.h with something like

>> #if !HAVE_SIZE_T typedef unsigned int size_t; #endif

Adam> I don't understand how it was "dead broken."  Can you please
Adam> just state the technical consequences of the previous syntax
Adam> that you were concerned about and let the goodness or badness of
Adam> those consequences make or fail to make the argument?

Look in the mailing lists two years ago for the requests of the
users.  Sorry, I don't remember the names of the threads.  But
basically, it was not working for other languages than C, doesn't work
for function types, pointer types and so on.

See Automake's implementation of AM_TYPE_PTRDIFF_T or whatever its
name to understand what other people had to do too.



Adam> I do not understand how it was worth the tradeoff to use the
Adam> same name and break a lot of existing code, 

Please, tell us what code, and we will adjust the heuristics.


Adam> especially when the failure mode that this induces is not easily
Adam> detectable (autoconf will not get an error, but rather the
Adam> program might fail to compile or will compile differently, and
Adam> you have to look carefully through config.log if you do not know
Adam> what you're talking about).  

Please, show that code, and how the warnings did not get triggered, so
that we can improve it.


Adam> It will probably be a year before all of the code that has this
Adam> problem is found and fixed.  If you want to change the semantics
Adam> of AC_CHECK_TYPE, can't you at least provide the old semantics
Adam> by some public function?

 - Macro: AC_CHECK_TYPE (TYPE, DEFAULT)
     Autoconf, up to 2.13, used to provide this version of
     `AC_CHECK_TYPE', deprecated because of its flaws.  Firstly,
     although it is a member of the `CHECK' clan, singular sub-family,
     it does more than just checking.  Second, missing types are not
     `typedef''d, they are `#define''d, which can lead to incompatible
     code in the case of pointer types.

     This use of `AC_CHECK_TYPE' is obsolete and discouraged, see *Note
     Generic Types::, for the description of the current macro.

     If the type TYPE is not defined, define it to be the C (or C++)
     builtin type DEFAULT; e.g., `short' or `unsigned'.

     This macro is equivalent to:

          AC_CHECK_TYPE([TYPE],
                        [AC_DEFINE([TYPE], [DEFAULT],
                                   [Define to `DEFAULT' if <sys/types.h>
                                    does not define.])])

     In order to keep backward compatibility, the two versions of
     `AC_CHECK_TYPE' are implemented, selected by a simple heuristics:

       1. If there are three or four arguments, the modern version is
          used.

       2. 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++ _builtin_ type or a C identifier ending in `_t',
          optionally followed by one of `[(* ' and then by a string of
          zero or more characters taken from the set `[]()* _a-zA-Z0-9'.

       3. If the second argument is spelled with the alphabet of valid
          C and C++ types, the user is warned and the modern version is
          used.

       4. Otherwise, the modern version is used.

     You are encouraged either to use a valid builtin type, or to use
     the equivalent modern code (see above), or better yet, to use
     `AC_CHECK_TYPES' together with

          #if !HAVE_LOFF_T
          typedef loff_t off_t;
          #endif



reply via email to

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