public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] fix two "2-1.c" tests of POSIX
@ 2010-08-18  7:13 Mitani
  2010-08-18  7:24 ` Garrett Cooper
  2010-08-18 16:51 ` Mike Frysinger
  0 siblings, 2 replies; 4+ messages in thread
From: Mitani @ 2010-08-18  7:13 UTC (permalink / raw)
  To: ltp-list; +Cc: 當座 健市

[-- Attachment #1: Type: text/plain, Size: 3193 bytes --]

Hi,

I tried to build open_posix_testsuite testcases with latest git:
   ltp-dev-e8ad463baada21fb19f4c06f7dcab75c420ae373.tar.gz

Several testcases failed to build.
Two of them is as follows:
------------
[...]
conformance/interfaces/pthread_attr_setstack/2-1 compile FAILED
In file included from
../../../conformance/interfaces/pthread_attr_setstack/2-1.c:31:
../../../include/posixtest.h:14:2: error: #error "Contains GNU-isms that
need fixing."
[...]
conformance/interfaces/pthread_attr_setstacksize/2-1 compile FAILED
In file included from
../../../conformance/interfaces/pthread_attr_setstacksize/2-1.c:31:
../../../include/posixtest.h:14:2: error: #error "Contains GNU-isms that
need fixing."
[...]
------------

".../pthread_attr_setstack/2-1.c" and ".../include/posixtest.h" are 
as follows:
------------(.../pthread_attr_setstack/2-1.c)
[...]
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <pthread.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/param.h>
#include <errno.h>
#include <unistd.h>
#include "posixtest.h"
[...]
------------

------------(posixtest.h)
[...]
#if defined(_GNU_SOURCE)
#error "Contains GNU-isms that need fixing."
#elif defined(_BSD_SOURCE)
#error "Contains BSD-isms that need fixing."
#endif
[...]
------------

In above "2-1.c", "_GNU_SOURCE" is defined. After that, "posixtest.h" 
is included.
And, in "posixtest.h", if "_GNU_SOURCE" is defined, error occurs.

If "#ifndef _GNU_SOURCE" is arranged after a line of "posixtest.h",
error doesn't occur.
I confirmed that build succeeded by this revision and the test 
became PASS.

Another "2-1.c" is same as above testcase.


Signed-off-by: Tomonori Mitani <mitani@ryobi.co.jp>

============
---
a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstac
k/2-1.c	2010-08-18 07:18:35.000000000 +0900
+++
b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstac
k/2-1.c	2010-08-18 15:43:16.000000000 +0900
@@ -17,9 +17,6 @@
  *       provided by nptl, which is developed by Ulrich Drepper.
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif 
 #include <pthread.h>
 #include <limits.h>
 #include <stdio.h>
@@ -30,6 +27,10 @@
 #include <unistd.h>
 #include "posixtest.h"
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
 #define TEST "2-1"
 #define FUNCTION "pthread_attr_setstack"
 #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
---
a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstac
ksize/2-1.c	2010-08-18 07:18:35.000000000 +0900
+++
b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstac
ksize/2-1.c	2010-08-18 15:44:56.000000000 +0900
@@ -17,9 +17,6 @@
  *       provided by nptl, which is developed by Ulrich Drepper.
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif 
 #include <pthread.h>
 #include <limits.h>
 #include <stdio.h>
@@ -30,6 +27,10 @@
 #include <unistd.h>
 #include "posixtest.h"
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
 #define TEST "2-1"
 #define FUNCTION "pthread_attr_setstacksize"
 #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
============



Regards--


-Tomonori Mitani

[-- Attachment #2: 2-1.patch --]
[-- Type: application/octet-stream, Size: 1456 bytes --]

--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c	2010-08-18 07:18:35.000000000 +0900
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c	2010-08-18 15:43:16.000000000 +0900
@@ -17,9 +17,6 @@
  *       provided by nptl, which is developed by Ulrich Drepper.
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif 
 #include <pthread.h>
 #include <limits.h>
 #include <stdio.h>
@@ -30,6 +27,10 @@
 #include <unistd.h>
 #include "posixtest.h"
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
 #define TEST "2-1"
 #define FUNCTION "pthread_attr_setstack"
 #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c	2010-08-18 07:18:35.000000000 +0900
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c	2010-08-18 15:44:56.000000000 +0900
@@ -17,9 +17,6 @@
  *       provided by nptl, which is developed by Ulrich Drepper.
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif 
 #include <pthread.h>
 #include <limits.h>
 #include <stdio.h>
@@ -30,6 +27,10 @@
 #include <unistd.h>
 #include "posixtest.h"
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
 #define TEST "2-1"
 #define FUNCTION "pthread_attr_setstacksize"
 #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "

[-- Attachment #3: Type: text/plain, Size: 224 bytes --]

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fix two "2-1.c" tests of POSIX
  2010-08-18  7:13 [LTP] [PATCH] fix two "2-1.c" tests of POSIX Mitani
@ 2010-08-18  7:24 ` Garrett Cooper
  2010-08-24  7:31   ` Mitani
  2010-08-18 16:51 ` Mike Frysinger
  1 sibling, 1 reply; 4+ messages in thread
From: Garrett Cooper @ 2010-08-18  7:24 UTC (permalink / raw)
  To: Mitani; +Cc: ltp-list, 當座 健市

2010/8/18 Mitani <mitani@ryobi.co.jp>:
> Hi,
>
> I tried to build open_posix_testsuite testcases with latest git:
>   ltp-dev-e8ad463baada21fb19f4c06f7dcab75c420ae373.tar.gz
>
> Several testcases failed to build.
> Two of them is as follows:
> ------------
> [...]
> conformance/interfaces/pthread_attr_setstack/2-1 compile FAILED
> In file included from
> ../../../conformance/interfaces/pthread_attr_setstack/2-1.c:31:
> ../../../include/posixtest.h:14:2: error: #error "Contains GNU-isms that
> need fixing."
> [...]
> conformance/interfaces/pthread_attr_setstacksize/2-1 compile FAILED
> In file included from
> ../../../conformance/interfaces/pthread_attr_setstacksize/2-1.c:31:
> ../../../include/posixtest.h:14:2: error: #error "Contains GNU-isms that
> need fixing."
> [...]
> ------------
>
> ".../pthread_attr_setstack/2-1.c" and ".../include/posixtest.h" are
> as follows:
> ------------(.../pthread_attr_setstack/2-1.c)
> [...]
> #ifndef _GNU_SOURCE
> #define _GNU_SOURCE
> #endif
> #include <pthread.h>
> #include <limits.h>
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> #include <sys/param.h>
> #include <errno.h>
> #include <unistd.h>
> #include "posixtest.h"
> [...]
> ------------
>
> ------------(posixtest.h)
> [...]
> #if defined(_GNU_SOURCE)
> #error "Contains GNU-isms that need fixing."
> #elif defined(_BSD_SOURCE)
> #error "Contains BSD-isms that need fixing."
> #endif
> [...]
> ------------
>
> In above "2-1.c", "_GNU_SOURCE" is defined. After that, "posixtest.h"
> is included.
> And, in "posixtest.h", if "_GNU_SOURCE" is defined, error occurs.
>
> If "#ifndef _GNU_SOURCE" is arranged after a line of "posixtest.h",
> error doesn't occur.
> I confirmed that build succeeded by this revision and the test
> became PASS.
>
> Another "2-1.c" is same as above testcase.
>
>
> Signed-off-by: Tomonori Mitani <mitani@ryobi.co.jp>
>
> ============
> ---
> a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstac
> k/2-1.c 2010-08-18 07:18:35.000000000 +0900
> +++
> b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstac
> k/2-1.c 2010-08-18 15:43:16.000000000 +0900
> @@ -17,9 +17,6 @@
>  *       provided by nptl, which is developed by Ulrich Drepper.
>  */
>
> -#ifndef _GNU_SOURCE
> -#define _GNU_SOURCE
> -#endif
>  #include <pthread.h>
>  #include <limits.h>
>  #include <stdio.h>
> @@ -30,6 +27,10 @@
>  #include <unistd.h>
>  #include "posixtest.h"
>
> +#ifndef _GNU_SOURCE
> +#define _GNU_SOURCE
> +#endif
> +
>  #define TEST "2-1"
>  #define FUNCTION "pthread_attr_setstack"
>  #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
> ---
> a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstac
> ksize/2-1.c     2010-08-18 07:18:35.000000000 +0900
> +++
> b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstac
> ksize/2-1.c     2010-08-18 15:44:56.000000000 +0900
> @@ -17,9 +17,6 @@
>  *       provided by nptl, which is developed by Ulrich Drepper.
>  */
>
> -#ifndef _GNU_SOURCE
> -#define _GNU_SOURCE
> -#endif
>  #include <pthread.h>
>  #include <limits.h>
>  #include <stdio.h>
> @@ -30,6 +27,10 @@
>  #include <unistd.h>
>  #include "posixtest.h"
>
> +#ifndef _GNU_SOURCE
> +#define _GNU_SOURCE
> +#endif
> +
>  #define TEST "2-1"
>  #define FUNCTION "pthread_attr_setstacksize"
>  #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "

This is intentional :). The tests need to be written to use only POSIX
compliant APIs. Otherwise, it isn't truly POSIX compliant.

Thanks,
-Garrett

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fix two "2-1.c" tests of POSIX
  2010-08-18  7:13 [LTP] [PATCH] fix two "2-1.c" tests of POSIX Mitani
  2010-08-18  7:24 ` Garrett Cooper
@ 2010-08-18 16:51 ` Mike Frysinger
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2010-08-18 16:51 UTC (permalink / raw)
  To: Mitani; +Cc: ltp-list, 當座 健市

2010/8/18 Mitani:
>  *       provided by nptl, which is developed by Ulrich Drepper.
>  */
>
> -#ifndef _GNU_SOURCE
> -#define _GNU_SOURCE
> -#endif
>  #include <pthread.h>
>  #include <limits.h>
>  #include <stdio.h>
> @@ -30,6 +27,10 @@
>  #include <unistd.h>
>  #include "posixtest.h"
>
> +#ifndef _GNU_SOURCE
> +#define _GNU_SOURCE
> +#endif

defining any _XXX_SOURCE after including any C library headers is
pointless as they are checked in C library headers
-mike

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fix two "2-1.c" tests of POSIX
  2010-08-18  7:24 ` Garrett Cooper
@ 2010-08-24  7:31   ` Mitani
  0 siblings, 0 replies; 4+ messages in thread
From: Mitani @ 2010-08-24  7:31 UTC (permalink / raw)
  To: 'Garrett Cooper', Mike Frysinger
  Cc: ltp-list, 當座 健市

[-- Attachment #1: Type: text/plain, Size: 6092 bytes --]



>The tests need to be written to use only POSIX compliant APIs.

>defining any _XXX_SOURCE after including any C library headers is pointless...

My means was not good.

This test-set is just for POSIX.
But, if "_GNU_SOURCE" is defined, unnecessary GNU function irrelevant 
to POSIX becomes effective.
Anyhow, definition of "_GNU_SOURCE" is not necessary about following 
two test-sets , I think.
  .../pthread_attr_setstack/2-1.c
  .../pthread_attr_setstacksize/2-1.c

I removed "_GNU_SOURCE" definition from these test-sets, and succeeded 
to build and run.


Signed-off-by: Tomonori Mitani <mitani@ryobi.co.jp>

============
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c	2010-08-23 07:02:43.000000000 +0900
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c	2010-08-24 11:40:41.000000000 +0900
@@ -15,9 +15,6 @@
  */
 
 /* For pthread_getattr_np(3) -- not a POSIX compliant API. */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <sys/param.h>
 #include <errno.h>
 #include <limits.h>
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c	2010-08-23 07:02:43.000000000 +0900
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c	2010-08-24 11:43:19.000000000 +0900
@@ -15,9 +15,6 @@
  */
 
 /* For pthread_getattr_np(3) -- not a POSIX compliant API */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <sys/param.h>
 #include <errno.h>
 #include <limits.h>
============


Thank you--


-Tomonori Mitani

> -----Original Message-----
> From: Garrett Cooper [mailto:yanegomi@gmail.com]
> Sent: Wednesday, August 18, 2010 4:25 PM
> To: Mitani
> Cc: ltp-list@lists.sourceforge.net; 當座 健市
> Subject: Re: [LTP] [PATCH] fix two "2-1.c" tests of POSIX
> 
> 2010/8/18 Mitani <mitani@ryobi.co.jp>:
> > Hi,
> >
> > I tried to build open_posix_testsuite testcases with latest git:
> >   ltp-dev-e8ad463baada21fb19f4c06f7dcab75c420ae373.tar.gz
> >
> > Several testcases failed to build.
> > Two of them is as follows:
> > ------------
> > [...]
> > conformance/interfaces/pthread_attr_setstack/2-1 compile FAILED
> > In file included from
> > ../../../conformance/interfaces/pthread_attr_setstack/2-1.c:31:
> > ../../../include/posixtest.h:14:2: error: #error "Contains
> GNU-isms that
> > need fixing."
> > [...]
> > conformance/interfaces/pthread_attr_setstacksize/2-1 compile
> FAILED
> > In file included from
> > ../../../conformance/interfaces/pthread_attr_setstacksize/2-1.c:
> 31:
> > ../../../include/posixtest.h:14:2: error: #error "Contains
> GNU-isms that
> > need fixing."
> > [...]
> > ------------
> >
> > ".../pthread_attr_setstack/2-1.c" and ".../include/posixtest.h"
> are
> > as follows:
> > ------------(.../pthread_attr_setstack/2-1.c)
> > [...]
> > #ifndef _GNU_SOURCE
> > #define _GNU_SOURCE
> > #endif
> > #include <pthread.h>
> > #include <limits.h>
> > #include <stdio.h>
> > #include <string.h>
> > #include <stdlib.h>
> > #include <sys/param.h>
> > #include <errno.h>
> > #include <unistd.h>
> > #include "posixtest.h"
> > [...]
> > ------------
> >
> > ------------(posixtest.h)
> > [...]
> > #if defined(_GNU_SOURCE)
> > #error "Contains GNU-isms that need fixing."
> > #elif defined(_BSD_SOURCE)
> > #error "Contains BSD-isms that need fixing."
> > #endif
> > [...]
> > ------------
> >
> > In above "2-1.c", "_GNU_SOURCE" is defined. After that,
> "posixtest.h"
> > is included.
> > And, in "posixtest.h", if "_GNU_SOURCE" is defined, error occurs.
> >
> > If "#ifndef _GNU_SOURCE" is arranged after a line of "posixtest.h",
> > error doesn't occur.
> > I confirmed that build succeeded by this revision and the test
> > became PASS.
> >
> > Another "2-1.c" is same as above testcase.
> >
> >
> > Signed-off-by: Tomonori Mitani <mitani@ryobi.co.jp>
> >
> > ============
> > ---
> >
> a/testcases/open_posix_testsuite/conformance/interfaces/pthread_at
> tr_setstac
> > k/2-1.c 2010-08-18 07:18:35.000000000 +0900
> > +++
> >
> b/testcases/open_posix_testsuite/conformance/interfaces/pthread_at
> tr_setstac
> > k/2-1.c 2010-08-18 15:43:16.000000000 +0900
> > @@ -17,9 +17,6 @@
> >  *       provided by nptl, which is developed by Ulrich Drepper.
> >  */
> >
> > -#ifndef _GNU_SOURCE
> > -#define _GNU_SOURCE
> > -#endif
> >  #include <pthread.h>
> >  #include <limits.h>
> >  #include <stdio.h>
> > @@ -30,6 +27,10 @@
> >  #include <unistd.h>
> >  #include "posixtest.h"
> >
> > +#ifndef _GNU_SOURCE
> > +#define _GNU_SOURCE
> > +#endif
> > +
> >  #define TEST "2-1"
> >  #define FUNCTION "pthread_attr_setstack"
> >  #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
> > ---
> >
> a/testcases/open_posix_testsuite/conformance/interfaces/pthread_at
> tr_setstac
> > ksize/2-1.c     2010-08-18 07:18:35.000000000 +0900
> > +++
> >
> b/testcases/open_posix_testsuite/conformance/interfaces/pthread_at
> tr_setstac
> > ksize/2-1.c     2010-08-18 15:44:56.000000000 +0900
> > @@ -17,9 +17,6 @@
> >  *       provided by nptl, which is developed by Ulrich Drepper.
> >  */
> >
> > -#ifndef _GNU_SOURCE
> > -#define _GNU_SOURCE
> > -#endif
> >  #include <pthread.h>
> >  #include <limits.h>
> >  #include <stdio.h>
> > @@ -30,6 +27,10 @@
> >  #include <unistd.h>
> >  #include "posixtest.h"
> >
> > +#ifndef _GNU_SOURCE
> > +#define _GNU_SOURCE
> > +#endif
> > +
> >  #define TEST "2-1"
> >  #define FUNCTION "pthread_attr_setstacksize"
> >  #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
> 
> This is intentional :). The tests need to be written to use only POSIX
> compliant APIs. Otherwise, it isn't truly POSIX compliant.
> 
> Thanks,
> -Garrett

[-- Attachment #2: 2-1.patch --]
[-- Type: application/octet-stream, Size: 933 bytes --]

--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c	2010-08-23 07:02:43.000000000 +0900
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c	2010-08-24 11:40:41.000000000 +0900
@@ -15,9 +15,6 @@
  */
 
 /* For pthread_getattr_np(3) -- not a POSIX compliant API. */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <sys/param.h>
 #include <errno.h>
 #include <limits.h>
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c	2010-08-23 07:02:43.000000000 +0900
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c	2010-08-24 11:43:19.000000000 +0900
@@ -15,9 +15,6 @@
  */
 
 /* For pthread_getattr_np(3) -- not a POSIX compliant API */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <sys/param.h>
 #include <errno.h>
 #include <limits.h>

[-- Attachment #3: Type: text/plain, Size: 392 bytes --]

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2010-08-24  7:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-18  7:13 [LTP] [PATCH] fix two "2-1.c" tests of POSIX Mitani
2010-08-18  7:24 ` Garrett Cooper
2010-08-24  7:31   ` Mitani
2010-08-18 16:51 ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox