Web lists-archives.com

Re: ssize_t




On 12/22/2016 02:51 PM, Hans-Bernhard Bröker wrote:
> Am 22.12.2016 um 20:39 schrieb Marco Atzeri:
> 
>> 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 ?
> 
> 
> The test case reduces to a very simple one-liner:
> 
> int bar = sizeof((int));
> 
> Replacing the double (()) by single () gets rid of the miscompilation.
> 
> That looks like a bona fide GCC bug.

That is NOT a gcc bug, but deliberate configure behavior.  Remember, not
ALL conftest compilation probes during configure failures are supposed
to compile - some are expected to fail.  Debugging configure failures
requires that you ALSO know whether the compilation failure is expected
(as in this case), by knowing additional context of WHY configure is
trying to compile the test code (here, to PROVE that ssize_t is an
actual type name, and not just a variable name that expands to an
expression rather than a type).

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

Attachment: signature.asc
Description: OpenPGP digital signature