[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lib/dirfd.c: compiler warning: unused parameter
|
From: |
Bruno Haible |
|
Subject: |
Re: lib/dirfd.c: compiler warning: unused parameter |
|
Date: |
Fri, 05 May 2023 12:13:09 +0200 |
Bjarni Ingi Gislason wrote:
> HAVE_DIRFD=1
> dnl Replace only if the system declares dirfd already.
> if test $ac_cv_have_decl_dirfd = yes; then
> -> REPLACE_DIRFD=0 /* FIX ME, was =1 */
> fi
Oh, indeed, there's a mistake here. I thought that it was OK
to compile lib/dirfd.c because <dirent.h> defines DIR, and
DIR is expected to have a d_fd or dd_fd member. But glibc
defines DIR in an opaque way. The d_fd or dd_fd member is
meant only as a fallback for systems that don't have the
dirfd function or macro.
It was my mistake on 2023-04-26. I would have noticed the
mistake if there had been a unit test for the 'dirfd' module.
So, let me add a unit test now.
2023-05-05 Bruno Haible <bruno@clisp.org>
dirfd: Add tests.
* tests/test-dirfd.c: New file.
* modules/dirfd-tests: New file.
2023-05-05 Bruno Haible <bruno@clisp.org>
dirfd: Fix bogus override (regression 2023-04-26).
Reported by Bjarni Ingi Gislason <bjarniig@simnet.is> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00040.html>.
* m4/dirfd.m4 (gl_FUNC_DIRFD): Fix mistake in last change.
0001-dirfd-Fix-bogus-override-regression-2023-04-26.patch
Description: Text Data
0002-dirfd-Add-tests.patch
Description: Text Data
- lib/dirfd.c: compiler warning: unused parameter, Bjarni Ingi Gislason, 2023/05/03
- Re: lib/dirfd.c: compiler warning: unused parameter, Bruno Haible, 2023/05/03
- Re: lib/dirfd.c: compiler warning: unused parameter, Bruno Haible, 2023/05/04
- Re: lib/dirfd.c: compiler warning: unused parameter, Bjarni Ingi Gislason, 2023/05/04
- Re: lib/dirfd.c: compiler warning: unused parameter,
Bruno Haible <=
- Re: lib/dirfd.c: compiler warning: unused parameter, Bernhard Voelker, 2023/05/07
- Re: coreutils CI, Bruno Haible, 2023/05/09
- Re: coreutils CI, Bernhard Voelker, 2023/05/11
- Re: coreutils CI, Pádraig Brady, 2023/05/11
- Re: coreutils CI, Bruno Haible, 2023/05/11
- Re: coreutils CI, Pádraig Brady, 2023/05/13
- Re: lib/dirfd.c: compiler warning: unused parameter, Paul Eggert, 2023/05/05