[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59586: Conflicting types for 'wait' in binutils test program

From: Jacob Bachmeyer
Subject: bug#59586: Conflicting types for 'wait' in binutils test program
Date: Fri, 25 Nov 2022 21:42:42 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20090807 SeaMonkey/1.1.17 Mnenhy/

John David Anglin wrote:


In dejagnu.h, we have:

wait (void)
  fd_set rfds;
  struct timeval tv;

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

  select (0, &rfds, NULL, NULL, &tv);

In fixed stdlib.h, we have:
# 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]