GNU bug report logs - #59586
Conflicting types for 'wait' in binutils test program

Previous Next

Package: dejagnu;

Reported by: John David Anglin <dave.anglin <at> bell.net>

Date: Fri, 25 Nov 2022 23:51:01 UTC

Owned by: jcb62281 <at> gmail.com

Severity: normal

Done: Jacob Bachmeyer <jcb62281 <at> gmail.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 59586 in the body.
You can then email your comments to 59586 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-dejagnu <at> gnu.org:
bug#59586; Package dejagnu. (Fri, 25 Nov 2022 23:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to John David Anglin <dave.anglin <at> bell.net>:
New bug report received and forwarded. Copy sent to bug-dejagnu <at> gnu.org. (Fri, 25 Nov 2022 23:51:02 GMT) Full text and rfc822 format available.

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

From: John David Anglin <dave.anglin <at> bell.net>
To: bug-dejagnu <at> gnu.org
Subject: Conflicting types for 'wait' in binutils test program
Date: Fri, 25 Nov 2022 18:44:07 -0500
https://sourceware.org/bugzilla/show_bug.cgi?id=29828

            Bug ID: 29828
           Summary: error: conflicting types for 'wait'
           Product: binutils
           Version: 2.40 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
              Host: hppa2.0w-hp-hpux11.11
            Target: hppa2.0w-hp-hpux11.11
             Build: hppa2.0w-hp-hpux11.11

make[2]: Entering directory '/home/dave/gnu/binutils/objdir/libsframe'
make  testsuite/libsframe.decode/be-flipping
testsuite/libsframe.decode/frecnt-1
 testsuite/libsframe.decode/frecnt-2 testsuite/libsframe.encode/encode-1
make[3]: Entering directory '/home/dave/gnu/binutils/objdir/libsframe'
gcc -DHAVE_CONFIG_H -I. -I../../src/libsframe -I../../src/libsframe/../include
-Wall  -Wall -Wextra -Wwrite-strings -Wmissing-format-attribute
-Wstrict-prototy
pes -Wmissing-prototypes -O2 -g     -MT
testsuite/libsframe.decode/testsuite_lib
sframe_decode_be_flipping-be-flipping.o -MD -MP -MF
testsuite/libsframe.decode/.
deps/testsuite_libsframe_decode_be_flipping-be-flipping.Tpo -c -o
testsuite/libs
frame.decode/testsuite_libsframe_decode_be_flipping-be-flipping.o `test -f
'test
suite/libsframe.decode/be-flipping.c' || echo
'../../src/libsframe/'`testsuite/l
ibsframe.decode/be-flipping.c
In file included from
../../src/libsframe/testsuite/libsframe.decode/be-flipping
.c:28:
/opt/gnu/include/dejagnu.h:48:1: error: conflicting types for 'wait'
   48 | wait (void)
      | ^~~~
In file included from
/home/opt/gnu/gcc/gcc-10/lib/gcc/hppa2.0w-hp-hpux11.11/10.
3.1/include-fixed/stdlib.h:307,
                 from
../../src/libsframe/testsuite/libsframe.decode/be-flipping
.c:21:
/usr/include/sys/wait.h:74:21: note: previous declaration of 'wait' was here
   74 |        extern pid_t wait(int *);
      |                     ^~~~
make[3]: *** [Makefile:733:
testsuite/libsframe.decode/testsuite_libsframe_decod
e_be_flipping-be-flipping.o] Error 1
make[3]: Target 'testsuite/libsframe.decode/be-flipping' not remade because of
e
rrors.

In dejagnu.h, we have:

void
wait (void)
{
#ifdef_DEJAGNU_WAIT_
  fd_set rfds;
  struct timeval tv;

  FD_ZERO (&rfds);
  tv.tv_sec = 0;
  tv.tv_usec = 1;

  select (0, &rfds, NULL, NULL, &tv);
#endif
}

In fixed stdlib.h, we have:
#ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED
# include <sys/wait.h>     /* For required W* macros */

Seems like a dejagnu bug. dejagnu-1.6.3 is installed.

Dave

-- 
John David Anglin  dave.anglin <at> bell.net





Owner recorded as jcb62281 <at> gmail.com. Request was from Jacob Bachmeyer <jcb62281 <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 26 Nov 2022 03:23:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-dejagnu <at> gnu.org:
bug#59586; Package dejagnu. (Sat, 26 Nov 2022 03:43:01 GMT) Full text and rfc822 format available.

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

From: Jacob Bachmeyer <jcb62281 <at> gmail.com>
To: John David Anglin <dave.anglin <at> bell.net>
Cc: 59586 <at> debbugs.gnu.org
Subject: Re: bug#59586: Conflicting types for 'wait' in binutils test program
Date: Fri, 25 Nov 2022 21:42:42 -0600
John David Anglin wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=29828
>
> [...]
>
> In dejagnu.h, we have:
>
> void
> wait (void)
> {
> #ifdef_DEJAGNU_WAIT_
>   fd_set rfds;
>   struct timeval tv;
>
>   FD_ZERO (&rfds);
>   tv.tv_sec = 0;
>   tv.tv_usec = 1;
>
>   select (0, &rfds, NULL, NULL, &tv);
> #endif
> }
>
> In fixed stdlib.h, we have:
> #ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED
> # include <sys/wait.h>     /* For required W* macros */
>
> Seems like a dejagnu bug. dejagnu-1.6.3 is installed.

The expectation (long before my time) seems to have been that DejaGnu 
unit test programs would not have subprocesses and therefore would not 
need <sys/wait.h> at all.  That said, name collisions with symbols 
defined by POSIX are clearly a bad idea.

The entire _DEJAGNU_WAIT_ feature appears to be an attempt at a 
workaround for an Expect caveat now documented in the DejaGnu manual.  
(Sub-subheading "Priority of Expect patterns" in the node "Writing a 
test case")  Since it appears to be a timing solution to a sequencing 
problem, I am likely to simply remove it.

This has been added to the list of other issues with dejagnu.h that are 
to be fixed prior to the 1.6.4 release.  The 1.6.4 release will be the 
first with significant attention to the C/C++ unit test facility since I 
became the lead maintainer for DejaGnu; there are also some current 
thread-safety issues that need to be addressed.

Thank you for reporting this issue.


-- Jacob





Information forwarded to bug-dejagnu <at> gnu.org:
bug#59586; Package dejagnu. (Tue, 29 Nov 2022 03:44:02 GMT) Full text and rfc822 format available.

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

From: Jacob Bachmeyer <jcb62281 <at> gmail.com>
To: John David Anglin <dave.anglin <at> bell.net>
Cc: 59586 <at> debbugs.gnu.org
Subject: Re: bug#59586: Conflicting types for 'wait' in binutils test program
Date: Mon, 28 Nov 2022 21:43:10 -0600
An initial patch has been pushed to Savannah in the 
"topic-improved-unit-test" branch.  Please confirm that this resolves 
your issues.  Further work is planned on that branch before it will be 
merged into master.

While DejaGnu itself can now be run directly from a Git checkout, you 
will need to ensure that the version of dejagnu.h included with DejaGnu 
is found by your compiler before the system copy, since this problem is 
related to that file.  If you want to test from a Git checkout, I 
suggest passing "CPPFLAGS=-I/name/of/git/checkout/for/dejagnu" on the 
configure command line and 
"RUNTEST=/name/of/git/checkout/for/dejagnu/runtest" on the make command 
line.


-- Jacob




Information forwarded to bug-dejagnu <at> gnu.org, jcb62281 <at> gmail.com:
bug#59586; Package dejagnu. (Wed, 30 Nov 2022 19:59:02 GMT) Full text and rfc822 format available.

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

From: John David Anglin <dave.anglin <at> bell.net>
To: jcb62281 <at> gmail.com
Cc: 59586 <at> debbugs.gnu.org
Subject: Re: bug#59586: Conflicting types for 'wait' in binutils test program
Date: Wed, 30 Nov 2022 14:58:02 -0500
On 2022-11-28 10:43 p.m., Jacob Bachmeyer wrote:
> An initial patch has been pushed to Savannah in the "topic-improved-unit-test" branch.  Please confirm that this resolves your issues.

The patch fixes the wait conflict in the binutils libsframe on hppa64-hp-hpux11.11.

Thanks,
Dave

-- 
John David Anglin  dave.anglin <at> bell.net





Reply sent to jcb62281 <at> gmail.com:
You have taken responsibility. (Thu, 01 Dec 2022 02:20:01 GMT) Full text and rfc822 format available.

Notification sent to John David Anglin <dave.anglin <at> bell.net>:
bug acknowledged by developer. (Thu, 01 Dec 2022 02:20:01 GMT) Full text and rfc822 format available.

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

From: Jacob Bachmeyer <jcb62281 <at> gmail.com>
To: John David Anglin <dave.anglin <at> bell.net>
Cc: 59586-done <at> debbugs.gnu.org
Subject: Re: bug#59586: Conflicting types for 'wait' in binutils test program
Date: Wed, 30 Nov 2022 20:19:25 -0600
John David Anglin wrote:
> On 2022-11-28 10:43 p.m., Jacob Bachmeyer wrote:
>> An initial patch has been pushed to Savannah in the 
>> "topic-improved-unit-test" branch.  Please confirm that this resolves 
>> your issues.
>
> The patch fixes the wait conflict in the binutils libsframe on 
> hppa64-hp-hpux11.11.

Since the patch removes wait() entirely, it will also fix other 
platforms.  Thanks for confirming that this was the cause.  The patch is 
now on track to land in 1.6.4, so I am closing this bug report.


-- Jacob





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 29 Dec 2022 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 251 days ago.

Previous Next


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