[Bug build/33089] [2.42 Regression] GCC 14.2.1 failed to build glibc

cvs-commit at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Mon Jun 16 06:49:35 GMT 2025


https://sourceware.org/bugzilla/show_bug.cgi?id=33089

--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5b7c8d1cd44048d6fbf10ad80e0d94dd90848a0d

commit 5b7c8d1cd44048d6fbf10ad80e0d94dd90848a0d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jun 15 11:01:30 2025 +0800

    Always check lockf64 return value

    On x86-64, when GCC 14.2.1 is used to build:

    commit f3c82fc1b41261f582f5f9fa12f74af9bcbc88f9
    Author: Radko Krkos <krkos@mail.muni.cz>
    Date:   Sat Jun 14 11:07:40 2025 +0200

        io: Mark lockf() __wur [BZ #32800]

        In commit 0476597b28 flock() was marked __wur in posix/unistd.h, but
not
        in io/fcntl.h, the declarations must match.

        Reviewed-by: Florian Weimer <fweimer@redhat.com>

    I got

    programs/locarchive.c: In function âopen_archiveâ:
    programs/locarchive.c:641:18: error: ignoring return value of âlockf64â
declared with attribute âwarn_unused_resultâ [-Werror=unused-result]
      641 |           (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
          |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    programs/locarchive.c:653:14: error: ignoring return value of âlockf64â
declared with attribute âwarn_unused_resultâ [-Werror=unused-result]
      653 |       (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
          |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    programs/locarchive.c:660:14: error: ignoring return value of âlockf64â
declared with attribute âwarn_unused_resultâ [-Werror=unused-result]
      660 |       (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
          |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    programs/locarchive.c:679:14: error: ignoring return value of âlockf64â
declared with attribute âwarn_unused_resultâ [-Werror=unused-result]
      679 |       (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
          |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Update locarchive.c to always check lockf64 return value.  This fixes
    BZ #33089.

    Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
    Reviewed-by: Florian Weimer <fweimer@redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list