Karim Belabas on Thu, 06 May 2004 00:59:34 +0200


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

Re: qsecretary notice


* Bill Allombert [2004-05-06 00:18]:
> On Wed, May 05, 2004 at 09:00:21PM +0200, Karim Belabas wrote:
>> * Bill Allombert [2004-05-05 13:31]:
>> > 2) That does not check whether the prototype for log2 exists, only
>> >    if the log2 symbol is in the library.
>>
>> This is correct, that's all we want. We do not want to try and work around
>> unknown, possibly broken or conflicting, headers. The autoconf way to do
>> things is even more paranoid:
>>
>>   #ifdef __cplusplus
>>   extern "C"
>>   #endif
>>   /* We use char because int might match the return type of a gcc2
>>      builtin and then its argument prototype would still apply.  */
>>   char fun ();
>>   int main () { fun (); return 0; }
>
> Are you sure ? I think it use
>
> char (*f) () = $ac_func;
>
> int
> main ()
> {
>   return f != $ac_func;
> }
>
> which will not compile if $ac_func has no prototype since,
> char (*f) () = $ac_func will report error: `$ac_func' undeclared'.

Interesting; my autoconf setup was rather outdated. With autoconf-2.59,
I indeed get the above.

>> Anyway, it's quite unimportant to "miss" either exp2 or log2: both are
>> almost unused.
>
> We will not miss it, we will find it where it is supposed to be hidden.
> We will try to use log2() without prototype which is likely to fail
> with a C++ compiler.

Hum... A gp binary compiled with the "corrected" detection of log2/exp2 is
completely broken.

OK, the autoconf way is obviously better. I've fixed the has_log2.c and
has_exp2.c tests.

Thanks,

    Karim.
-- 
Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dep. de Mathematiques, Bat. 425   Fax: (+33) (0)1 69 15 60 19
Universite Paris-Sud              http://www.math.u-psud.fr/~belabas/ 
F-91405 Orsay (France)            http://pari.math.u-bordeaux.fr/  [PARI/GP]