This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/10159] New: Exit status inspection macros fail on const argument


The macros accompanying wait() fail to compile when given a const argument under
certain conditions. A testcase follows.

#define _GNU_SOURCE

#include <stdlib.h>

#include <sys/types.h>
#include <sys/wait.h>

void foo (void)
{
	const int status = 0;

	(void) WIFEXITED    (status);
	(void) WEXITSTATUS  (status);
	(void) WIFSIGNALED  (status);
	(void) WTERMSIG     (status);
	(void) WIFSTOPPED   (status);
	(void) WSTOPSIG     (status);
	(void) WIFCONTINUED (status);
}

The compilation succeeds if
* <stdlib.h> is included after the two other headers
* <stdlib.h> is not included at all
* _GNU_SOURCE is not defined

The compiler used is GCC 4.3. This was tested on Gentoo and Debian GNU/Linux
distributions.

-- 
           Summary: Exit status inspection macros fail on const argument
           Product: glibc
           Version: 2.9
            Status: NEW
          Severity: minor
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: andrey dot vihrov at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10159

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]