GNU bug report logs - #20536
avoid new gcc warning: ENOTSUP vs EOPNOTSUPP

Previous Next

Package: coreutils;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sat, 9 May 2015 18:16:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20536 in the body.
You can then email your comments to 20536 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#20536; Package coreutils. (Sat, 09 May 2015 18:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Meyering <jim <at> meyering.net>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 09 May 2015 18:16:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: bug-coreutils <at> gnu.org
Subject: avoid new gcc warning: ENOTSUP vs EOPNOTSUPP
Date: Sat, 9 May 2015 11:15:07 -0700
[Message part 1 (text/plain, inline)]
Building with very new gcc-from-git, I encountered 3 new warnings.
Here's a patch to address them:

Without this change, very recent gcc (e.g., version 6.0.0 20150509)
would print the following when configured with --enable-gcc-warnings:

  src/copy.c:165:30: error: logical 'or' of equal expressions \
    [-Werror=logical-op]
    && (errno == EOPNOTSUPP || errno == ENOTSUP || errno == ENOSYS))
                           ^
* src/system.h (is_ENOTSUP): New function.
* src/copy.c (punch_hole): Use it.
* src/ls.c (errno_unsupported, gobble_file): Use it.
[0001-build-avoid-a-warning-form-gcc-s-new-Wlogical-op.patch (application/octet-stream, attachment)]

Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Sat, 09 May 2015 22:20:04 GMT) Full text and rfc822 format available.

Notification sent to Jim Meyering <jim <at> meyering.net>:
bug acknowledged by developer. (Sat, 09 May 2015 22:20:06 GMT) Full text and rfc822 format available.

Message #10 received at 20536-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jim Meyering <jim <at> meyering.net>, 20536-done <at> debbugs.gnu.org
Subject: Re: bug#20536: avoid new gcc warning: ENOTSUP vs EOPNOTSUPP
Date: Sat, 09 May 2015 23:19:41 +0100
On 09/05/15 19:15, Jim Meyering wrote:
> Building with very new gcc-from-git, I encountered 3 new warnings.
> Here's a patch to address them:
> 
> Without this change, very recent gcc (e.g., version 6.0.0 20150509)
> would print the following when configured with --enable-gcc-warnings:
> 
>   src/copy.c:165:30: error: logical 'or' of equal expressions \
>     [-Werror=logical-op]
>     && (errno == EOPNOTSUPP || errno == ENOTSUP || errno == ENOSYS))
>                            ^
> * src/system.h (is_ENOTSUP): New function.
> * src/copy.c (punch_hole): Use it.
> * src/ls.c (errno_unsupported, gobble_file): Use it.

Not sure I agree with GCC's warning here,
but the fix looks good.

Marking this as done.

thanks!
Pádraig




Information forwarded to bug-coreutils <at> gnu.org:
bug#20536; Package coreutils. (Sun, 10 May 2015 14:18:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jim Meyering <jim <at> meyering.net>, 20536 <at> debbugs.gnu.org
Subject: Re: bug#20536: avoid new gcc warning: ENOTSUP vs EOPNOTSUPP
Date: Sun, 10 May 2015 07:17:15 -0700
Jim Meyering wrote:
> +  return err == EOPNOTSUPP
> +#if ENOTSUP != EOPNOTSUPP
> +    || err == ENOTSUP
> +#endif
> +    ;

Would the following work instead?  It's a bit cleaner to avoid #if:

  return err == EOPNOTSUPP || (ENOTSUP != EOPNOTSUPP && err == ENOTSUP);





Information forwarded to bug-coreutils <at> gnu.org:
bug#20536; Package coreutils. (Sun, 10 May 2015 15:36:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 20536 <at> debbugs.gnu.org
Subject: Re: bug#20536: avoid new gcc warning: ENOTSUP vs EOPNOTSUPP
Date: Sun, 10 May 2015 08:34:51 -0700
On Sun, May 10, 2015 at 7:17 AM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> Jim Meyering wrote:
>>
>> +  return err == EOPNOTSUPP
>> +#if ENOTSUP != EOPNOTSUPP
>> +    || err == ENOTSUP
>> +#endif
>> +    ;
>
> Would the following work instead?  It's a bit cleaner to avoid #if:
>
>   return err == EOPNOTSUPP || (ENOTSUP != EOPNOTSUPP && err == ENOTSUP);

I confirmed that too avoids the warning, so I've pushed it in your name.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Jun 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 17 days ago.

Previous Next


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