GNU bug report logs -
#59818
incomplete type 'struct pollfd', etc., when compiling tail on MacOS (patch included)
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59818 in the body.
You can then email your comments to 59818 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#59818
; Package
coreutils
.
(Sun, 04 Dec 2022 16:54:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Dennis Williamson <dennis <at> netstrata.com>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Sun, 04 Dec 2022 16:54:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
I received the errors for tail.c shown below when compiling coreutils on
MacOS (11.6). Adding __APPLE__ to the #if defined for poll.h fixes the
issue (see the diff at the bottom). Making this change matches that line
to the one within check_output_alive().
commit 324c188cfd8a1628c260e5003d309613a0c66e57 (August 29, 2022) made
the change to check_output_alive(), but missed the change reported here.
Dennis
(HEAD: aaa306ad76d48b27efd75101d57b6ec5bf90362c)
Error:
CC src/tail.o
src/tail.c:367:17: error: variable has incomplete type 'struct pollfd'
struct pollfd pfd;
^
src/tail.c:367:10: note: forward declaration of 'struct pollfd'
struct pollfd pfd;
^
src/tail.c:370:17: error: use of undeclared identifier 'POLLRDBAND'
pfd.events |= POLLRDBAND; /* Needed for illumos, macos. */
^
src/tail.c:372:7: error: implicit declaration of function 'poll' is
invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (poll (&pfd, 1, 0) >= 0 && (pfd.revents & (POLLERR | POLLHUP)))
^
src/tail.c:372:49: error: use of undeclared identifier 'POLLERR'
if (poll (&pfd, 1, 0) >= 0 && (pfd.revents & (POLLERR | POLLHUP)))
^
src/tail.c:372:59: error: use of undeclared identifier 'POLLHUP'
if (poll (&pfd, 1, 0) >= 0 && (pfd.revents & (POLLERR | POLLHUP)))
^
5 errors generated.
make[2]: *** [src/tail.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Diff:
diff --git a/src/tail.c b/src/tail.c
index 6c7d59faf..14abf0871 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -55,7 +55,7 @@
# include <sys/inotify.h>
#endif
-#if defined _AIX || defined __sun || HAVE_INOTIFY
+#if defined _AIX || defined __sun || defined __APPLE__ || HAVE_INOTIFY
# include <poll.h>
#endif
Reply sent
to
Pádraig Brady <P <at> draigBrady.com>
:
You have taken responsibility.
(Mon, 05 Dec 2022 14:41:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Dennis Williamson <dennis <at> netstrata.com>
:
bug acknowledged by developer.
(Mon, 05 Dec 2022 14:41:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 59818-done <at> debbugs.gnu.org (full text, mbox):
On 04/12/2022 15:55, Dennis Williamson wrote:
> I received the errors for tail.c shown below when compiling coreutils on
> MacOS (11.6). Adding __APPLE__ to the #if defined for poll.h fixes the
> issue (see the diff at the bottom). Making this change matches that line
> to the one within check_output_alive().
>
> commit 324c188cfd8a1628c260e5003d309613a0c66e57 (August 29, 2022) made
> the change to check_output_alive(), but missed the change reported here.
>
> Dennis
>
> (HEAD: aaa306ad76d48b27efd75101d57b6ec5bf90362c)
>
> Error:
>
> CC src/tail.o
> src/tail.c:367:17: error: variable has incomplete type 'struct pollfd'
> struct pollfd pfd;
Pushed at https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=02441761c
thank you,
Pádraig
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 03 Jan 2023 12:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 168 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.