Web lists-archives.com

Re: ssize_t




On 12/22/2016 01:39 PM, Marco Atzeri wrote:
> Hi guys,
> 
> building latest Imagemagick, the test for ssize_t is now failing with a
> puzzling
> 
>  $ gcc  ssize_t.c -o ssize_t
> ssize_t.c: In function ‘main’:
> ssize_t.c:115:22: error: expected expression before ‘)’ token
>  if (sizeof ((ssize_t)))
>                       ^
> 
> any clue what to look for ?

That's probably SUPPOSED to happen.

Autoconf tests for type names by comparing:

sizeof(TYPE) /* should compile */

with

sizeof((TYPE)) /* should not compile */

If 'TYPE' is instead a constant, then both forms will compile.  So it
allows you to probe whether an unknown string (in this case 'ssize_t')
is a type name or some other macro that expands into a constant.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature