All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] openposix: Remove _XOPEN_SOURCE in strchr/strcpy/strncpy
@ 2018-12-06  9:40 Xiao Yang
  2018-12-06 14:26 ` Cyril Hrubis
  2018-12-07 10:00 ` Petr Vorel
  0 siblings, 2 replies; 4+ messages in thread
From: Xiao Yang @ 2018-12-06  9:40 UTC (permalink / raw)
  To: ltp

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.

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>
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] openposix: Remove _XOPEN_SOURCE in strchr/strcpy/strncpy
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2018-12-06 14:26 UTC (permalink / raw)
  To: ltp

Hi!
Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] openposix: Remove _XOPEN_SOURCE in strchr/strcpy/strncpy
  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
  2018-12-09 20:27   ` Enji Cooper
  1 sibling, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2018-12-07 10:00 UTC (permalink / raw)
  To: ltp

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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] openposix: Remove _XOPEN_SOURCE in strchr/strcpy/strncpy
  2018-12-07 10:00 ` Petr Vorel
@ 2018-12-09 20:27   ` Enji Cooper
  0 siblings, 0 replies; 4+ messages in thread
From: Enji Cooper @ 2018-12-09 20:27 UTC (permalink / raw)
  To: ltp

All,
	I think we should try moving forward to 700. Staying at 600 doesn’t really buy us much in the longterm (it’s testing the 2001 POSIX spec), and the underlying implementation likely supports both—unless the implementers were pedantic, and anecdotally this hasn’t been the general case in GNU/Linux, compared to *BSD.
	Thank you Xiao for pointing this out. I misunderstood what you meant in the PR.
	I’ll push for removing the _XOPEN_SOURCE #defines and bumping the version to 700.
Thank you!
-Enji

> On Dec 7, 2018, at 2:00 AM, Petr Vorel <pvorel@suse.cz> wrote:
> 
> 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 part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.linux.it/pipermail/ltp/attachments/20181209/8ef721c8/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-09 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2018-12-09 20:27   ` Enji Cooper

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.