All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xenpaging: remove XOPEN_SOURCE
@ 2011-12-13  9:30 Roger Pau Monne
  2011-12-13 10:02 ` Ian Campbell
  2011-12-14 13:37 ` Olaf Hering
  0 siblings, 2 replies; 9+ messages in thread
From: Roger Pau Monne @ 2011-12-13  9:30 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1323768129 -3600
# Node ID 7697ee23b08b8eaca9aee4f6b79cf550a490bef7
# Parent  8a84f53376862427f254a017cb52c928dbdd3d32
xenpaging: remove XOPEN_SOURCE

The XOPEN_SOURCE define was breaking the compilation under NetBSD.
I've removed it becasue it is not necessary (at least under NetBSD).
If it is necessary for Linux, we can add a ifdef conditional to remove
this only under NetBSD.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

diff -r 8a84f5337686 -r 7697ee23b08b tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Tue Dec 13 09:49:55 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Tue Dec 13 10:22:09 2011 +0100
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define _XOPEN_SOURCE	600
 #define _GNU_SOURCE
 
 #include <inttypes.h>

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

* Re: [PATCH] xenpaging: remove XOPEN_SOURCE
  2011-12-13  9:30 [PATCH] xenpaging: remove XOPEN_SOURCE Roger Pau Monne
@ 2011-12-13 10:02 ` Ian Campbell
  2011-12-13 10:39   ` Laszlo Ersek
  2011-12-14 13:37 ` Olaf Hering
  1 sibling, 1 reply; 9+ messages in thread
From: Ian Campbell @ 2011-12-13 10:02 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel@lists.xensource.com

On Tue, 2011-12-13 at 09:30 +0000, Roger Pau Monne wrote:
> # HG changeset patch
> # User Roger Pau Monne <roger.pau@entel.upc.edu>
> # Date 1323768129 -3600
> # Node ID 7697ee23b08b8eaca9aee4f6b79cf550a490bef7
> # Parent  8a84f53376862427f254a017cb52c928dbdd3d32
> xenpaging: remove XOPEN_SOURCE
> 
> The XOPEN_SOURCE define was breaking the compilation under NetBSD.

How?

> I've removed it becasue it is not necessary (at least under NetBSD).
> If it is necessary for Linux, we can add a ifdef conditional to remove
> this only under NetBSD.

Removing it seems to not break Linux, at least for me.

> Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r 8a84f5337686 -r 7697ee23b08b tools/xenpaging/xenpaging.c
> --- a/tools/xenpaging/xenpaging.c	Tue Dec 13 09:49:55 2011 +0100
> +++ b/tools/xenpaging/xenpaging.c	Tue Dec 13 10:22:09 2011 +0100
> @@ -18,7 +18,6 @@
>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
>   */
>  
> -#define _XOPEN_SOURCE	600
>  #define _GNU_SOURCE
>  
>  #include <inttypes.h>
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: [PATCH] xenpaging: remove XOPEN_SOURCE
  2011-12-13 10:02 ` Ian Campbell
@ 2011-12-13 10:39   ` Laszlo Ersek
  2011-12-13 13:21     ` Roger Pau Monné
  0 siblings, 1 reply; 9+ messages in thread
From: Laszlo Ersek @ 2011-12-13 10:39 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Roger Pau Monne, xen-devel@lists.xensource.com

On 12/13/11 11:02, Ian Campbell wrote:
> On Tue, 2011-12-13 at 09:30 +0000, Roger Pau Monne wrote:
>> # HG changeset patch
>> # User Roger Pau Monne<roger.pau@entel.upc.edu>
>> # Date 1323768129 -3600
>> # Node ID 7697ee23b08b8eaca9aee4f6b79cf550a490bef7
>> # Parent  8a84f53376862427f254a017cb52c928dbdd3d32
>> xenpaging: remove XOPEN_SOURCE
>>
>> The XOPEN_SOURCE define was breaking the compilation under NetBSD.
>
> How?

Indeed. Both the commit that added it [1] [2] and this patch provide 
very little useful info in their respective messages. It's interesting 
because it could point out a SUSv3 incompatibility in in NetBSD.

>> I've removed it becasue it is not necessary (at least under NetBSD).
>> If it is necessary for Linux, we can add a ifdef conditional to remove
>> this only under NetBSD.
>
> Removing it seems to not break Linux, at least for me.

The stuff made visible by _GNU_SOURCE (with glibc) includes everything 
_XOPEN_SOURCE makes visible [3]. [4] introduced it because of asprintf().

Laszlo

[1] 
http://old-list-archives.xen.org/archives/html/xen-devel/2010-08/msg01110.html
[2] http://xenbits.xensource.com/hg/xen-unstable.hg/rev/22023
[3] 
http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#index-g_t_005fGNU_005fSOURCE-51
[4] http://xenbits.xensource.com/hg/xen-unstable.hg/rev/24223


>
>> Signed-off-by: Roger Pau Monne<roger.pau@entel.upc.edu>
>
> Acked-by: Ian Campbell<ian.campbell@citrix.com>
>>
>> diff -r 8a84f5337686 -r 7697ee23b08b tools/xenpaging/xenpaging.c
>> --- a/tools/xenpaging/xenpaging.c	Tue Dec 13 09:49:55 2011 +0100
>> +++ b/tools/xenpaging/xenpaging.c	Tue Dec 13 10:22:09 2011 +0100
>> @@ -18,7 +18,6 @@
>>    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
>>    */
>>
>> -#define _XOPEN_SOURCE	600
>>   #define _GNU_SOURCE
>>
>>   #include<inttypes.h>

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

* Re: [PATCH] xenpaging: remove XOPEN_SOURCE
  2011-12-13 10:39   ` Laszlo Ersek
@ 2011-12-13 13:21     ` Roger Pau Monné
  2011-12-13 14:53       ` Ian Jackson
  0 siblings, 1 reply; 9+ messages in thread
From: Roger Pau Monné @ 2011-12-13 13:21 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: xen-devel@lists.xensource.com, Ian Campbell

2011/12/13 Laszlo Ersek <lersek@redhat.com>:
> On 12/13/11 11:02, Ian Campbell wrote:
>>
>> On Tue, 2011-12-13 at 09:30 +0000, Roger Pau Monne wrote:
>>>
>>> # HG changeset patch
>>> # User Roger Pau Monne<roger.pau@entel.upc.edu>
>>> # Date 1323768129 -3600
>>> # Node ID 7697ee23b08b8eaca9aee4f6b79cf550a490bef7
>>> # Parent  8a84f53376862427f254a017cb52c928dbdd3d32
>>> xenpaging: remove XOPEN_SOURCE
>>>
>>> The XOPEN_SOURCE define was breaking the compilation under NetBSD.
>>
>>
>> How?

If _XOPEN_SOUCE is defined, then the compiler cannot find the
prototype of asprintf and it throws a warning that stops the
compilation.

This is because the prototype of asprintf is declared as follows under NetBSD:

#if defined(_NETBSD_SOURCE)
[...]
int      asprintf(char ** __restrict, const char * __restrict, ...)
                __printflike(2, 3);
[...]
#endif

And _NETBSD_SOURCE is defined if:

#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
    !defined(_XOPEN_SOURCE) && !defined(_NETBSD_SOURCE)
#define _NETBSD_SOURCE 1
#endif

Probably the asprintf prototype should be defined as:

#if defined(_NETBSD_SOURCE) || defined(_XOPEN_SOURCE)
[...]
int      asprintf(char ** __restrict, const char * __restrict, ...)
                __printflike(2, 3);
>
> Indeed. Both the commit that added it [1] [2] and this patch provide very
> little useful info in their respective messages. It's interesting because it
> could point out a SUSv3 incompatibility in in NetBSD.
>
>
>>> I've removed it becasue it is not necessary (at least under NetBSD).
>>> If it is necessary for Linux, we can add a ifdef conditional to remove
>>> this only under NetBSD.
>>
>>
>> Removing it seems to not break Linux, at least for me.
>
>
> The stuff made visible by _GNU_SOURCE (with glibc) includes everything
> _XOPEN_SOURCE makes visible [3]. [4] introduced it because of asprintf().

If it's not necessary I think it's best to remove the definition, to
avoid having a lot of useless defines all over the code.

> Laszlo
>
> [1]
> http://old-list-archives.xen.org/archives/html/xen-devel/2010-08/msg01110.html
> [2] http://xenbits.xensource.com/hg/xen-unstable.hg/rev/22023
> [3]
> http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#index-g_t_005fGNU_005fSOURCE-51
> [4] http://xenbits.xensource.com/hg/xen-unstable.hg/rev/24223
>
>
>
>>
>>> Signed-off-by: Roger Pau Monne<roger.pau@entel.upc.edu>
>>
>>
>> Acked-by: Ian Campbell<ian.campbell@citrix.com>
>>>
>>>
>>> diff -r 8a84f5337686 -r 7697ee23b08b tools/xenpaging/xenpaging.c
>>> --- a/tools/xenpaging/xenpaging.c       Tue Dec 13 09:49:55 2011 +0100
>>> +++ b/tools/xenpaging/xenpaging.c       Tue Dec 13 10:22:09 2011 +0100
>>> @@ -18,7 +18,6 @@
>>>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
>>>  USA
>>>   */
>>>
>>> -#define _XOPEN_SOURCE  600
>>>  #define _GNU_SOURCE
>>>
>>>  #include<inttypes.h>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [PATCH] xenpaging: remove XOPEN_SOURCE
  2011-12-13 13:21     ` Roger Pau Monné
@ 2011-12-13 14:53       ` Ian Jackson
  2011-12-14 10:14         ` Roger Pau Monné
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Jackson @ 2011-12-13 14:53 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: xen-devel@lists.xensource.com, Laszlo Ersek, Ian Campbell

Roger Pau Monné writes ("Re: [Xen-devel] [PATCH] xenpaging: remove XOPEN_SOURCE"):
> 2011/12/13 Laszlo Ersek <lersek@redhat.com>:
> > The stuff made visible by _GNU_SOURCE (with glibc) includes everything
> > _XOPEN_SOURCE makes visible [3]. [4] introduced it because of asprintf().
> 
> If it's not necessary I think it's best to remove the definition, to
> avoid having a lot of useless defines all over the code.

I disagree.  The purpose of these kind of macros is purely to allow
systems to claim standards-compliance and absence of namespace
pollution, by default.

The logical conclusion is that these kind of problems should be fixed
by adding more requests for platform-specific features, not removing
them.

In this case that would mean adding:
 #define _NETBSD_SOURCE

If the prevalance of these kind of macros is getting irritating they
can easily be moved into a common header file somewhere.

Ian.

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

* Re: [PATCH] xenpaging: remove XOPEN_SOURCE
  2011-12-13 14:53       ` Ian Jackson
@ 2011-12-14 10:14         ` Roger Pau Monné
  2011-12-14 10:23           ` Olaf Hering
  0 siblings, 1 reply; 9+ messages in thread
From: Roger Pau Monné @ 2011-12-14 10:14 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel@lists.xensource.com, Laszlo Ersek, Ian Campbell

2011/12/13 Ian Jackson <Ian.Jackson@eu.citrix.com>:
> I disagree.  The purpose of these kind of macros is purely to allow
> systems to claim standards-compliance and absence of namespace
> pollution, by default.
>
> The logical conclusion is that these kind of problems should be fixed
> by adding more requests for platform-specific features, not removing
> them.
>
> In this case that would mean adding:
>  #define _NETBSD_SOURCE
>
> If the prevalance of these kind of macros is getting irritating they
> can easily be moved into a common header file somewhere.

Ok, I will resend the patch adding _NETBSD_SOURCE instead of removing
_XOPEN_SOURCE.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [PATCH] xenpaging: remove XOPEN_SOURCE
  2011-12-14 10:14         ` Roger Pau Monné
@ 2011-12-14 10:23           ` Olaf Hering
  2011-12-14 11:02             ` Roger Pau Monné
  0 siblings, 1 reply; 9+ messages in thread
From: Olaf Hering @ 2011-12-14 10:23 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Laszlo Ersek, xen-devel@lists.xensource.com, Ian Jackson,
	Ian Campbell

On Wed, Dec 14, Roger Pau Monné wrote:

> Ok, I will resend the patch adding _NETBSD_SOURCE instead of removing
> _XOPEN_SOURCE.

How do other source files with asprintf() calls compile for you? (libxl)
Why is xenpaging special?

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [PATCH] xenpaging: remove XOPEN_SOURCE
  2011-12-14 10:23           ` Olaf Hering
@ 2011-12-14 11:02             ` Roger Pau Monné
  0 siblings, 0 replies; 9+ messages in thread
From: Roger Pau Monné @ 2011-12-14 11:02 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Ian Jackson, xen-devel@lists.xensource.com, Laszlo Ersek,
	Ian Campbell

2011/12/14 Olaf Hering <olaf@aepfle.de>:
> On Wed, Dec 14, Roger Pau Monné wrote:
>
>> Ok, I will resend the patch adding _NETBSD_SOURCE instead of removing
>> _XOPEN_SOURCE.
>
> How do other source files with asprintf() calls compile for you? (libxl)
> Why is xenpaging special?

libxl doesn't define _XOPEN_SOURCE although it uses asprintf, and
other places that define _XOPEN_SOURCE don't use asprintf, that's why
I didn't have problems with that before.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [PATCH] xenpaging: remove XOPEN_SOURCE
  2011-12-13  9:30 [PATCH] xenpaging: remove XOPEN_SOURCE Roger Pau Monne
  2011-12-13 10:02 ` Ian Campbell
@ 2011-12-14 13:37 ` Olaf Hering
  1 sibling, 0 replies; 9+ messages in thread
From: Olaf Hering @ 2011-12-14 13:37 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

On Tue, Dec 13, Roger Pau Monne wrote:

> # HG changeset patch
> # User Roger Pau Monne <roger.pau@entel.upc.edu>
> # Date 1323768129 -3600
> # Node ID 7697ee23b08b8eaca9aee4f6b79cf550a490bef7
> # Parent  8a84f53376862427f254a017cb52c928dbdd3d32
> xenpaging: remove XOPEN_SOURCE
> 
> The XOPEN_SOURCE define was breaking the compilation under NetBSD.
> I've removed it becasue it is not necessary (at least under NetBSD).
> If it is necessary for Linux, we can add a ifdef conditional to remove
> this only under NetBSD.

Please resend with the exact error message in NetBSD.

24223:9e3c2ef70c8a should have removed  _XOPEN_SOURCE, and
22023:af6799abc6e9 should have added  _GNU_SOURCE in the first place
(and give the exact error message as well).

Other than that:

Acked-by: Olaf Hering <olaf@aepfle.de>

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

end of thread, other threads:[~2011-12-14 13:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-13  9:30 [PATCH] xenpaging: remove XOPEN_SOURCE Roger Pau Monne
2011-12-13 10:02 ` Ian Campbell
2011-12-13 10:39   ` Laszlo Ersek
2011-12-13 13:21     ` Roger Pau Monné
2011-12-13 14:53       ` Ian Jackson
2011-12-14 10:14         ` Roger Pau Monné
2011-12-14 10:23           ` Olaf Hering
2011-12-14 11:02             ` Roger Pau Monné
2011-12-14 13:37 ` Olaf Hering

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.