From unknown Sat Jun 21 05:04:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59818: incomplete type 'struct pollfd', etc., when compiling tail on MacOS (patch included) Resent-From: Dennis Williamson Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 04 Dec 2022 16:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59818 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 59818@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167017281215920 (code B ref -1); Sun, 04 Dec 2022 16:54:01 +0000 Received: (at submit) by debbugs.gnu.org; 4 Dec 2022 16:53:32 +0000 Received: from localhost ([127.0.0.1]:58647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1sFA-00048c-8V for submit@debbugs.gnu.org; Sun, 04 Dec 2022 11:53:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:58956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1rZu-0001Mc-P2 for submit@debbugs.gnu.org; Sun, 04 Dec 2022 11:10:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1rZu-00081T-HD for bug-coreutils@gnu.org; Sun, 04 Dec 2022 11:10:54 -0500 Received: from gwa7.newtekwebhosting.com ([63.134.207.36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1p1rZr-0008K6-S4 for bug-coreutils@gnu.org; Sun, 04 Dec 2022 11:10:54 -0500 Received: from maila5.newtekwebhosting.com (MAILA5.CRYSTALTECH.com [216.119.106.46]) by GWA7.newtekwebhosting.com with SMTP (version=TLS\Tls12 cipher=Aes256 bits=256); Sun, 4 Dec 2022 08:55:39 -0700 Received: from [10.27.14.101] (104-10-140-195.lightspeed.hstntx.sbcglobal.net [104.10.140.195]) by maila5.newtekwebhosting.com with SMTP; Sun, 4 Dec 2022 08:55:04 -0700 Message-ID: <98bd19cf-35a5-fecd-5a8c-39cce62834f6@netstrata.com> Date: Sun, 4 Dec 2022 09:55:03 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US From: Dennis Williamson Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=63.134.207.36; envelope-from=dennis@netstrata.com; helo=GWA7.newtekwebhosting.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Mailman-Approved-At: Sun, 04 Dec 2022 11:53:30 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) 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  #endif -#if defined _AIX || defined __sun || HAVE_INOTIFY +#if defined _AIX || defined __sun || defined __APPLE__ || HAVE_INOTIFY  # include  #endif From unknown Sat Jun 21 05:04:36 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dennis Williamson Subject: bug#59818: closed (Re: bug#59818: incomplete type 'struct pollfd', etc., when compiling tail on MacOS (patch included)) Message-ID: References: <7852eaf2-b331-032a-f47c-83202c374677@draigBrady.com> <98bd19cf-35a5-fecd-5a8c-39cce62834f6@netstrata.com> X-Gnu-PR-Message: they-closed 59818 X-Gnu-PR-Package: coreutils Reply-To: 59818@debbugs.gnu.org Date: Mon, 05 Dec 2022 14:41:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1670251262-14766-1" This is a multi-part message in MIME format... ------------=_1670251262-14766-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #59818: incomplete type 'struct pollfd', etc., when compiling tail on MacOS= (patch included) which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 59818@debbugs.gnu.org. --=20 59818: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D59818 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1670251262-14766-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 59818-done) by debbugs.gnu.org; 5 Dec 2022 14:40:51 +0000 Received: from localhost ([127.0.0.1]:36375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2CeJ-0003po-4w for submit@debbugs.gnu.org; Mon, 05 Dec 2022 09:40:51 -0500 Received: from mail-wm1-f45.google.com ([209.85.128.45]:34717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2CeH-0003pi-HJ for 59818-done@debbugs.gnu.org; Mon, 05 Dec 2022 09:40:49 -0500 Received: by mail-wm1-f45.google.com with SMTP id ay8-20020a05600c1e0800b003d0808d2826so5994606wmb.1 for <59818-done@debbugs.gnu.org>; Mon, 05 Dec 2022 06:40:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=dN0UG9alW54LN36dhpzX4X7Ckm0WfE/yi+3LNXUdnzc=; b=S6j0JX1B9v6iUHjbFNcZQBtGKrAgatc1vm5h4KplcmrHeMXhXcFhIO4gmV5u7QXqT9 fjK7Rd4BjjSAC2s7F7vxpa5q0BjkwGSLirh+sn3bsjXUhsXllP93fWi33uNs6m/VZJcf ps6XCaj1n5y5TiHdQYp32Al4rAkl12gOl8MiiT4EnqIkzEy2zr8ixoSdHa9EaDjF9MZX nBxvugF/fvlrvMaO9ewZMeLkOk9F9REGViPIgwogkJb0u+M1KTkfK0Fc/+yAAKvqBhWX xe/K6puZjYyFqgvqygYv+4QZF/N1U4aBo0HqTfgIeVJGU174vaJchc9ahSIhYK25WeQt ZZCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dN0UG9alW54LN36dhpzX4X7Ckm0WfE/yi+3LNXUdnzc=; b=jLzjRshRJoqvsCbdyKYi9HfVu0t+k9zrWl2I7ylIXzRkFN/xstj0nomJ1q4bzxefKX J1niY8/mHbpWQyd/gpbMV/qZGZJYhI+2HGmyIeYazNXl1uHaYq0llUjs7xwJPDnj0Myx rl64lRzRHrHOgI2An/i4KdSor+enrOKeMUX9xcDmzjgxiHDn8Bhg+JX0x2DeEv9DQooy hd/0qTb7dLZC8ACmnoOAXfuahmo3wIUtc52P6pUGlGY1ihL08LIFZ8dBw4iTkuPykbvG 0MPIa1OQgzJs47imIldHhq8igjY4EC8ADmXys5R1nZ8Itxb0r2JKTd5uAYwiHQCnr80o EFOA== X-Gm-Message-State: ANoB5pn/fk+iTbmcLAguyHYQSE7Hxu6h1QRDdoMcfAo0FsgTQaZxW7ED efvE4nB9hUvM0X5d4YkEkDurzTJ9nxM= X-Google-Smtp-Source: AA0mqf49dg4tWSQoq/Pt+pj4QTMsQt9SumXG2kpGs0r1XSIc3ikYaICTZ/OWRWWjeQ8K+caqrXotFQ== X-Received: by 2002:a05:600c:3b97:b0:3d0:8a2f:27e7 with SMTP id n23-20020a05600c3b9700b003d08a2f27e7mr9388938wms.42.1670251243411; Mon, 05 Dec 2022 06:40:43 -0800 (PST) Received: from [192.168.1.9] (95-44-90-175-dynamic.agg2.lod.rsl-rtd.eircom.net. [95.44.90.175]) by smtp.googlemail.com with ESMTPSA id u11-20020a5d6acb000000b00241c4bd6c09sm14239493wrw.33.2022.12.05.06.40.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 06:40:42 -0800 (PST) Message-ID: <7852eaf2-b331-032a-f47c-83202c374677@draigBrady.com> Date: Mon, 5 Dec 2022 14:40:41 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0 Subject: Re: bug#59818: incomplete type 'struct pollfd', etc., when compiling tail on MacOS (patch included) Content-Language: en-US To: Dennis Williamson , 59818-done@debbugs.gnu.org References: <98bd19cf-35a5-fecd-5a8c-39cce62834f6@netstrata.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= In-Reply-To: <98bd19cf-35a5-fecd-5a8c-39cce62834f6@netstrata.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 59818-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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 ------------=_1670251262-14766-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Dec 2022 16:53:32 +0000 Received: from localhost ([127.0.0.1]:58647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1sFA-00048c-8V for submit@debbugs.gnu.org; Sun, 04 Dec 2022 11:53:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:58956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1rZu-0001Mc-P2 for submit@debbugs.gnu.org; Sun, 04 Dec 2022 11:10:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1rZu-00081T-HD for bug-coreutils@gnu.org; Sun, 04 Dec 2022 11:10:54 -0500 Received: from gwa7.newtekwebhosting.com ([63.134.207.36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1p1rZr-0008K6-S4 for bug-coreutils@gnu.org; Sun, 04 Dec 2022 11:10:54 -0500 Received: from maila5.newtekwebhosting.com (MAILA5.CRYSTALTECH.com [216.119.106.46]) by GWA7.newtekwebhosting.com with SMTP (version=TLS\Tls12 cipher=Aes256 bits=256); Sun, 4 Dec 2022 08:55:39 -0700 Received: from [10.27.14.101] (104-10-140-195.lightspeed.hstntx.sbcglobal.net [104.10.140.195]) by maila5.newtekwebhosting.com with SMTP; Sun, 4 Dec 2022 08:55:04 -0700 Message-ID: <98bd19cf-35a5-fecd-5a8c-39cce62834f6@netstrata.com> Date: Sun, 4 Dec 2022 09:55:03 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US To: bug-coreutils@gnu.org From: Dennis Williamson Subject: incomplete type 'struct pollfd', etc., when compiling tail on MacOS (patch included) Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=63.134.207.36; envelope-from=dennis@netstrata.com; helo=GWA7.newtekwebhosting.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 04 Dec 2022 11:53:30 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) 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  #endif -#if defined _AIX || defined __sun || HAVE_INOTIFY +#if defined _AIX || defined __sun || defined __APPLE__ || HAVE_INOTIFY  # include  #endif ------------=_1670251262-14766-1--