[Skiboot] [PATCH] GCOV: Fix compilation error

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Fri Jun 26 15:51:49 AEST 2015


On gcc v4.9.2 we are hitting below error.

[ HOSTCC ] extract-gcov.c
In file included from /usr/include/stdint.h:25:0,
	from /usr/lib/gcc/x86_64-redhat-linux/4.9.2/include/stdint.h:9,
	from /data/opensource/pkvm/skiboot/ccan/short_types/short_types.h:4,
	from extract-gcov.c:18:
/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
							      ^
cc1: all warnings being treated as errors
/data/opensource/pkvm/skiboot/Makefile.main:179: recipe for target 'extract-gcov' failed

>From features.h header file:
  /* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for
  _DEFAULT_SOURCE.  If _DEFAULT_SOURCE is present we do not
  issue a warning; the expectation is that the source is being
  transitioned to use the new macro.  */

Hence replace _BSD_SOURCE with _DEFAULT_SOURCE.

Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
CC: Stewart Smith <stewart at linux.vnet.ibm.com>
---
Stewart,
  I hope I've not broken compilation on Ubuntu.. But I've not tested :-(
  This works on Fedora 21.

Vasant

 extract-gcov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extract-gcov.c b/extract-gcov.c
index 17fa25a..8320b3a 100644
--- a/extract-gcov.c
+++ b/extract-gcov.c
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #include <ccan/short_types/short_types.h>
 #include <endian.h>
 #include <sys/types.h>
-- 
2.1.0



More information about the Skiboot mailing list