GNU bug report logs - #22087
Problem with stdbuf configure test for 8.24 on Solaris with Studio C compiler.

Previous Next

Package: coreutils;

Reported by: Rich Burridge <rich.burridge <at> oracle.com>

Date: Thu, 3 Dec 2015 18:59:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 22087 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Bob Proulx <bob <at> proulx.com>, Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 22087 <at> debbugs.gnu.org, Rich Burridge <rich.burridge <at> oracle.com>
Subject: Re: bug#22087: Problem with stdbuf configure test for 8.24 on Solaris
 with Studio C compiler.
Date: Thu, 3 Dec 2015 14:07:22 -0700
[Message part 1 (text/plain, inline)]
On 12/03/2015 02:02 PM, Bob Proulx wrote:
> Paul Eggert wrote:
>> How about the attached (untested) patch instead? It should fix the
>> underlying problem, and thus avoid the need for fiddling with compiler
>> flags.
> 
>> diff --git a/configure.ac b/configure.ac
>> index 66c8cbe..3f546e9 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -475,7 +475,8 @@ AC_LINK_IFELSE(
>>      {
>>        stdbuf = 1;
>>      }]],[[
>> -    return !(stdbuf == 1);]])
>> +    if (stdbuf != 1)
>> +      return 1;]])
>>    ],
>>    [stdbuf_supported=yes])
>>  AC_MSG_RESULT([$stdbuf_supported])
> 
> Fallthrough return 0?

Yes, autoconf's AC_LINK_IFELSE provides an automatic 'return 0;' after
anything you supply in your macro arguments, when it builds conftest.c.

>  Or is a return 0 already defaulted?  It stood
> out to me that the previous return was unconditional and without an
> else or a fallthrough this is a change from the previous control flow.
> 
>   -    return !(stdbuf == 1);]])
>   +    if (stdbuf != 1)
>   +      return 1;
>   +    return 0;]])

Explicitly listing 'return 0;' here would result in a doubled-up return
0 in the overall conftest.c file.

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

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 9 years and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.