bug-autoconf
[Top][All Lists]
Advanced

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

Re: AC_CHECK_SIZEOF


From: Ralf Wildenhues
Subject: Re: AC_CHECK_SIZEOF
Date: Wed, 11 Apr 2007 05:36:34 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Eric,

Thanks for the bug report.  I gather that it is against Autoconf 2.59
(please note the version you're looking at, esp. if it's not the current
one).

* Eric Lemings wrote on Tue, Apr 10, 2007 at 01:55:40AM CEST:
>  
> Does not work for function pointer types, e.g.
> 
> AC_CHECK_SIZEOF(void (*)())
> AC_CHECK_SIZEOF(void (struct::*)())
> 
> because of this line in the _AC_CHECK_TYPE_NEW macro
> 
> 146 [if (($1 *) 0)
> 
> which is invalid for such pointer types.

Well, the test looks differently in 2.61, but it still doesn't work
for function pointer types, as the first line of this test output is
invalid:

[...]
| typedef void (*)() ac__type_new_;
| int
| main ()
| {
| if ((ac__type_new_ *) 0)
|   return 0;
| if (sizeof (ac__type_new_))
|   return 0;
|   ;
|   return 0;
| }

A good workaround would be to use a typedef (tested with 2.61):
  AC_CHECK_SIZEOF([fp], [], [typedef void (*fp)();])

I don't see a simple way for Autoconf to deal with function types
short of writing a parser for C function declarations, for the
AC_CHECK_{TYPE,TYPES,SIZEOF,ALIGNOF} macros.

Hope that helps.

Cheers,
Ralf




reply via email to

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