From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8782 invoked by alias); 28 Jan 2014 01:51:41 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 8453 invoked by uid 89); 28 Jan 2014 01:51:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f169.google.com Received: from mail-lb0-f169.google.com (HELO mail-lb0-f169.google.com) (209.85.217.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 28 Jan 2014 01:51:39 +0000 Received: by mail-lb0-f169.google.com with SMTP id q8so5082944lbi.14 for ; Mon, 27 Jan 2014 17:51:36 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.152.170.135 with SMTP id am7mr19500279lac.23.1390873896141; Mon, 27 Jan 2014 17:51:36 -0800 (PST) Received: by 10.112.143.70 with HTTP; Mon, 27 Jan 2014 17:51:36 -0800 (PST) In-Reply-To: <52E6F7B2.3040109@johndubchak.com> References: <52E6D62D.30804@johndubchak.com> <52E6E030.1020104@johndubchak.com> <52E6E3CB.3050503@johndubchak.com> <52E6EE2E.5040909@johndubchak.com> <52E6F7B2.3040109@johndubchak.com> Date: Tue, 28 Jan 2014 01:51:00 -0000 Message-ID: Subject: Re: Compile error: 'siginfo_t' is not declared using gcc-4.8.2 on RedHat, 6.4 From: Jonathan Wakely To: John Dubchak Cc: gcc-help Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00109.txt.bz2 On 28 January 2014 00:20, John Dubchak wrote: > On 1/27/14 3:45 PM, Jonathan Wakely wrote: >> >> >> You're adding -E to the link command, that's not going to work. To get >> the preprocessed output you need to preprocess the source file that's >> failing to compile, not the object files. >> > > I have preprocessed my main.cpp, which is the only cpp file listed in the > original error: > > In file included from http_server_signals.hpp:12:0, > from http_server.hpp:21, > from http_service_traits.hpp:15, > from main.cpp:14: > /usr/include/sys/wait.h:155:52: error: =E2=80=98siginfo_t=E2=80=99 has no= t been declared > extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop, > > Here is the preprocessed output for the http_server_signals.hpp file: > > # 20 "http_server.hpp" 2 > > # 1 "http_server_signals.hpp" 1 > # 10 "http_server_signals.hpp" > # 1 "/usr/local/gcc-4.8.2/include/c++/4.8.2/cerrno" 1 3 > # 39 "/usr/local/gcc-4.8.2/include/c++/4.8.2/cerrno" 3 > > # 40 "/usr/local/gcc-4.8.2/include/c++/4.8.2/cerrno" 3 > > # 1 "/usr/include/errno.h" 1 3 4 > # 42 "/usr/local/gcc-4.8.2/include/c++/4.8.2/cerrno" 2 3 > # 11 "http_server_signals.hpp" 2 > > # 1 "/usr/include/sys/wait.h" 1 3 4 > # 29 "/usr/include/sys/wait.h" 3 4 > extern "C" { > # 102 "/usr/include/sys/wait.h" 3 4 > typedef enum > { > P_ALL, > P_PID, > P_PGID > } idtype_t; > # 116 "/usr/include/sys/wait.h" 3 4 > extern __pid_t wait (void * __stat_loc); > # 139 "/usr/include/sys/wait.h" 3 4 > extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options); > > > # 1 "/usr/include/bits/siginfo.h" 1 3 4 > # 25 "/usr/include/bits/siginfo.h" 3 4 > # 1 "/usr/include/bits/wordsize.h" 1 3 4 > # 26 "/usr/include/bits/siginfo.h" 2 3 4 > # 144 "/usr/include/sys/wait.h" 2 3 4 > # 155 "/usr/include/sys/wait.h" 3 4 > extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop, > int __options); > > struct rusage; > > extern __pid_t wait3 (void * __stat_loc, int __options, > struct rusage * __usage) throw (); > > extern __pid_t wait4 (__pid_t __pid, void * __stat_loc, int __options, > struct rusage *__usage) throw (); > > } > # 13 "http_server_signals.hpp" 2 > > > static void sig_handler(int sig) { > if (sig =3D=3D 2) { > int status =3D 0; > int savedErrno =3D (*__errno_location ()); > while (waitpid(-1, &status, 1) > 0) > continue; > (*__errno_location ()) =3D savedErrno; > } else if (sig =3D=3D 1) { > int status =3D 0; > int savedErrno =3D (*__errno_location ()); > while (waitpid(-1, &status, 1) > 0) > continue; > (*__errno_location ()) =3D savedErrno; > } else if (sig =3D=3D 15) { > int status =3D 0; > int savedErrno =3D (*__errno_location ()); > while (waitpid(-1, &status, 1) > 0) > continue; > (*__errno_location ()) =3D savedErrno; > } else if (sig =3D=3D 17) { > int status =3D 0; > int savedErrno =3D (*__errno_location ()); > while (waitpid(-1, &status, 1) > 0) > continue; > (*__errno_location ()) =3D savedErrno; > } > } > > If I am reading this correctly, the siginfo_t definition is available when > preprocessed. > > Is there anything obvious that I might be missing? I still think you're not including when you should be. That could be because some other header defines _SIGNAL_H, which would prevent from defining anything, including __need_siginfo_t, so that doesn't define it. Does one of your headers use _SIGNAL_H as an include guard?