xenpaging: remove _XOPEN_SOURCE
PATCH v2 1/1 xenpaging: remove _XOPEN_SOURCE
# HG changeset patch
# User Roger Pau Monne <[email protected]> # Date 1323871725 -3600
# Node ID 3bac38f7a427af3eb9f60db08d0c2394bdf416dc # Parent 75eff8e03cb4c2e0361cddf2baf6f7719bc76653
xenpaging: remove _XOPEN_SOURCE
The _XOPEN_SOURCE define was breaking the compilation under NetBSD. I've removed it becasue it is not necessary.
Error message:
gcc -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value
-Wdeclaration-after-statement -D__XEN_TOOLS__ -MMD -MF
.xenpaging.o.d -fno-optimize-sibling-calls -I/root/xen-04102011/tools/xenpaging/../../tools/libxc -I/root/xen-04102011/tools/xenpaging/../../tools/include -I/root/xen-04102011/tools/xenpaging/../../tools/xenstore -I/root/xen-04102011/tools/xenpaging/../../tools/include -Werror -Wno-unused -g -c -o xenpaging.o xenpaging.c -I/usr/xen42/include -I/usr/include
cc1: warnings being treated as errorsxenpaging.c: In function 'xenpaging_init':
xenpaging.c:333: warning: implicit declaration of function 'asprintf'
tools/xenpaging/xenpaging.c +0 -1
@@ -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>
Roger Pau Monne writes ("[Xen-devel] [PATCH v2] xenpaging: remove _XOPEN_SOURCE"):
Quoted 4 lines
xenpaging: remove
_XOPEN_SOURCEThe
_XOPEN_SOURCEdefine was breaking the compilation under NetBSD. I've removed it becasue it is not necessary.
I thought we'd decided that _NETBSD_SOURCE should be added ?
Ian.
2011/12/15 Ian Jackson <[email protected]>:
Quoted 7 lines
Roger Pau Monne writes ("[Xen-devel] [PATCH v2] xenpaging: remove
_XOPEN_SOURCE"):Quoted 4 lines
xenpaging: remove
_XOPEN_SOURCEThe
_XOPEN_SOURCEdefine was breaking the compilation under NetBSD. I've removed it becasue it is not necessary.I thought we'd decided that
_NETBSD_SOURCEshould be added ?
Olaf Hering acked the patch with the condition that I add the error message, since you didn't say anything I through you where fine with that. Should I send the patch with _NETBSD_SOURCE instead?
Roger Pau Monné writes ("Re: [Xen-devel] [PATCH v2] xenpaging: remove _XOPEN_SOURCE"):
Quoted 3 lines
Olaf Hering acked the patch with the condition that I add the error message, since you didn't say anything I through you where fine with that. Should I send the patch with
_NETBSD_SOURCEinstead?
Did you not see my message, copy below ?
Thanks,
Ian.
From: Ian Jackson <[email protected]>
To: Roger Pau Monn� <[email protected]>
Cc: Laszlo Ersek <[email protected]>,
"[email protected]" <[email protected]>, Ian Campbell <[email protected]>
Subject: Re: [Xen-devel] [PATCH] xenpaging: remove XOPEN_SOURCE
Message-ID: <[email protected]>
Date: Tue, 13 Dec 2011 14:53:22 +0000
Roger Pau Monn� writes ("Re: [Xen-devel] [PATCH] xenpaging: remove XOPEN_SOURCE"):
Quoted 6 lines
2011/12/13 Laszlo Ersek <[email protected]>:
Quoted 2 lines
The stuff made visible by
_GNU_SOURCE(with glibc) includes everything_XOPEN_SOURCEmakes visible [3]. [4] introduced it because ofasprintf().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.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
2011/12/15 Ian Jackson <[email protected]>:
Quoted 6 lines
Roger Pau Monné writes ("Re: [Xen-devel] [PATCH v2] xenpaging: remove
_XOPEN_SOURCE"):Quoted 3 lines
Olaf Hering acked the patch with the condition that I add the error message, since you didn't say anything I through you where fine with that. Should I send the patch with
_NETBSD_SOURCEinstead?Did you not see my message, copy below ?
Sorry I think I got them in the wrong order.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Roger Pau Monné writes ("Re: [Xen-devel] [PATCH v2] xenpaging: remove _XOPEN_SOURCE"):
Quoted 9 lines
2011/12/15 Ian Jackson <[email protected]>:
Quoted 6 lines
Roger Pau Monné writes ("Re: [Xen-devel] [PATCH v2] xenpaging: remove
_XOPEN_SOURCE"):Quoted 3 lines
Olaf Hering acked the patch with the condition that I add the error message, since you didn't say anything I through you where fine with that. Should I send the patch with
_NETBSD_SOURCEinstead?Did you not see my message, copy below ?
Sorry I think I got them in the wrong order.
NP. It's quite possible that my message came after Olaf's, anyway.
Ian.
Quoted 7 lines · Ian Jackson
Roger Pau Monne writes ("[Xen-devel] [PATCH v2] xenpaging: remove
_XOPEN_SOURCE"):Quoted 4 lines
xenpaging: remove
_XOPEN_SOURCEThe
_XOPEN_SOURCEdefine was breaking the compilation under NetBSD. I've removed it becasue it is not necessary.I thought we'd decided that
_NETBSD_SOURCEshould be added ?
The initial patch which added _XOPEN_SOURCE should have a reasonable description which includes the error message, and it should have been _GNU_SOURCE instead of _XOPEN_SOURCE in the first place.
Please remove _XOPEN_SOURCE.
Olaf
2011/12/15 Olaf Hering <[email protected]>:
Quoted 8 lines · Ian Jackson
Quoted 7 lines
Roger Pau Monne writes ("[Xen-devel] [PATCH v2] xenpaging: remove
_XOPEN_SOURCE"):Quoted 4 lines
xenpaging: remove
_XOPEN_SOURCEThe
_XOPEN_SOURCEdefine was breaking the compilation under NetBSD. I've removed it becasue it is not necessary.
Quoted 7 lines
Quoted 1 line
I thought we'd decided that
_NETBSD_SOURCEshould be added ?The initial patch which added
_XOPEN_SOURCEshould have a reasonable description which includes the error message, and it should have been_GNU_SOURCEinstead of_XOPEN_SOURCEin the first place.Please remove
_XOPEN_SOURCE.
Both patches are on the list, now it's up to Ian Jackson to decide which one to apply.
Roger.