From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] openposix: Remove _XOPEN_SOURCE in strchr/strcpy/strncpy
Date: Fri, 7 Dec 2018 11:00:13 +0100 [thread overview]
Message-ID: <20181207100013.GA14165@dell5510> (raw)
In-Reply-To: <1544089211-8138-1-git-send-email-yangx.jy@cn.fujitsu.com>
Hi Xiao,
> We have defined _XOPEN_SOURCE to 600 by gcc -D in open_posix_testsuite/CFLAGS,
> So defining _XOPEN_SOURCE to different value in test results in a "_XOPEN_SOURCE
> redefined" warning.
> It seems that all of tests get pass even if _XOPEN_SOURCE is defined to 600
> by default, so remove the duplicate _XOPEN_SOURCE in test.
FYI I also mentioned it in https://github.com/linux-test-project/ltp/pull/423
but it was ignored.
This is a side effect, that we use mailing list and github pull requests.
I guess _XOPEN_SOURCE 600 is ok.
If _XOPEN_SOURCE 700 is really needed, we can use:
#ifdef _XOPEN_SOURCE
#undef _XOPEN_SOURCE
#endif
#define _XOPEN_SOURCE 700
Kind regards,
Petr
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
> testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c | 1 -
> testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c | 1 -
> testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c | 1 -
> testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c | 1 -
> 4 files changed, 4 deletions(-)
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c
> index 95eda79..611a64d 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c
> @@ -25,7 +25,6 @@
> * -Repeat the above all steps for given number of iterations.
> */
> -#define _XOPEN_SOURCE 700
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c
> index 2fdc002..adfbfc3 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c
> @@ -17,7 +17,6 @@
> * -Also compare returned pointer with s2.
> */
> -#define _XOPEN_SOURCE 700
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c
> index 3458015..396bd60 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c
> @@ -20,7 +20,6 @@
> * -Repeat the above steps for given number of iterations.
> */
> -#define _XOPEN_SOURCE 700
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c
> index a7761c5..2a20872 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c
> @@ -20,7 +20,6 @@
> * -Repeat the above steps for given number of iterations.
> */
> -#define _XOPEN_SOURCE 700
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
next prev parent reply other threads:[~2018-12-07 10:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-06 9:40 [LTP] [PATCH] openposix: Remove _XOPEN_SOURCE in strchr/strcpy/strncpy Xiao Yang
2018-12-06 14:26 ` Cyril Hrubis
2018-12-07 10:00 ` Petr Vorel [this message]
2018-12-09 20:27 ` Enji Cooper
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=20181207100013.GA14165@dell5510 \
--to=pvorel@suse.cz \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox