From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] openposix/20-1-buildonly, signal_h_23-1: Fix compiler errors on newer glibc
Date: Wed, 16 Jan 2019 17:04:33 +0800 [thread overview]
Message-ID: <5C3EF3A1.30503@cn.fujitsu.com> (raw)
In-Reply-To: <1545304294-31111-1-git-send-email-yangx.jy@cn.fujitsu.com>
Hi,
Ping. :-)
I also fix the wrong version of _POSIX_C_SOURCE in bsd_signal(3) manpage, as below:
https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=8eb09b1283be57333e7c6223080e7449479b7677
Best Regards,
Xiao Yang
On 2018/12/20 19:11, Xiao Yang wrote:
> Since glibc 2.26, the __USE_XOPEN2K8 macro defined by _POSIX_C_SOURCE = 200809L&&
> _XOPEN_SOURCE = 700 resulted in the following compiler errors, because both sigstack
> structure and bsd_signal function are only declared if __USE_XOPEN_EXTENDED is
> defined and __USE_XOPEN2K8 is not defined:
> -------------------------------------------------------------------------------
> 20-1-buildonly.c:13:8: error: invalid use of undefined type ‘struct sigstack’
> sp = t.ss_sp;
> ...
> signal_h/23-1.c:15:13: error: ‘bsd_signal’ undeclared (first use in this function); did you mean ‘psignal’?
> dummyvar = bsd_signal;
> -------------------------------------------------------------------------------
>
> We just use _POSIX_C_SOURCE = 200112L&& _XOPEN_SOURCE = 600 to run these tests.
>
> References:
> https://sourceware.org/git/?p=glibc.git;a=commit;h=666c0c5efa6db73632a6894bf028fef9f3b60d71
> https://sourceware.org/git/?p=glibc.git;a=commit;h=4c3992fc459322a7c712700ba3244fcb125163d7
>
> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> ---
> .../conformance/definitions/signal_h/20-1-buildonly.c | 7 +++++++
> .../open_posix_testsuite/conformance/definitions/signal_h/23-1.c | 7 +++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/testcases/open_posix_testsuite/conformance/definitions/signal_h/20-1-buildonly.c b/testcases/open_posix_testsuite/conformance/definitions/signal_h/20-1-buildonly.c
> index 21d8cb4..fdb2fb8 100644
> --- a/testcases/open_posix_testsuite/conformance/definitions/signal_h/20-1-buildonly.c
> +++ b/testcases/open_posix_testsuite/conformance/definitions/signal_h/20-1-buildonly.c
> @@ -2,6 +2,13 @@
> Test the definition of sigstack.
> */
>
> +#if _POSIX_C_SOURCE>= 200809L
> +# undef _POSIX_C_SOURCE
> +# undef _XOPEN_SOURCE
> +# define _POSIX_C_SOURCE 200112L
> +# define _XOPEN_SOURCE 600
> +#endif
> +
> #include<signal.h>
>
> struct sigstack this_type_should_exist, t;
> diff --git a/testcases/open_posix_testsuite/conformance/definitions/signal_h/23-1.c b/testcases/open_posix_testsuite/conformance/definitions/signal_h/23-1.c
> index 9a4d200..4f22e07 100644
> --- a/testcases/open_posix_testsuite/conformance/definitions/signal_h/23-1.c
> +++ b/testcases/open_posix_testsuite/conformance/definitions/signal_h/23-1.c
> @@ -5,6 +5,13 @@
> is declared.
> */
>
> +#if _POSIX_C_SOURCE>= 200809L
> +# undef _POSIX_C_SOURCE
> +# undef _XOPEN_SOURCE
> +# define _POSIX_C_SOURCE 200112L
> +# define _XOPEN_SOURCE 600
> +#endif
> +
> #include<signal.h>
>
> typedef void (*(*bsd_signal_test) (int, void (*)(int))) (int);
next prev parent reply other threads:[~2019-01-16 9:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-20 11:11 [LTP] [PATCH] openposix/20-1-buildonly, signal_h_23-1: Fix compiler errors on newer glibc Xiao Yang
2019-01-16 9:04 ` Xiao Yang [this message]
2019-01-21 7:18 ` [LTP] [PATCH v2] openposix/20-1-buildonly: Remove test for sigstack structure Xiao Yang
2019-01-21 7:22 ` Enji Cooper
2019-01-21 7:40 ` Xiao Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5C3EF3A1.30503@cn.fujitsu.com \
--to=yangx.jy@cn.fujitsu.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.