mdhender / cook

Peter Miller's cook
GNU General Public License v3.0
7 stars 4 forks source link

_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE #16

Open mdhender opened 3 years ago

mdhender commented 3 years ago

Compiling on Ubuntu 20.04 gives the following warning:

warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

Seems to be an old issue that's finally catching up to my compiler chain.

https://stackoverflow.com/questions/29201515/what-does-d-default-source-do

https://github.com/HardySimpson/zlog/issues/119

https://github.com/cxong/cdogs-sdl/issues/334

mdhender commented 3 years ago

Running CPPFLAGS="-D _DEFAULT_SOURCE" ./configure hides the problem. Need to investigate if this is the best solution.

pgeorgi commented 2 years ago
diff -ur aegis-4.25/common/ac/unistd.h aegis-4.25.try1/common/ac/unistd.h
--- aegis-4.25/common/ac/unistd.h       2012-12-04 03:03:31.000000000 +0100
+++ aegis-4.25/common/ac/unistd.h  2022-07-13 23:36:26.447981375 +0200
@@ -27,8 +27,10 @@
 // and readlink functions.
 //
 #ifdef __linux__
 #ifndef _BSD_SOURCE
 #define _BSD_SOURCE
+#ifndef _DEFAULT_SOURCE
+#define _DEFAULT_SOURCE
 #endif
 #ifndef __USE_BSD
 #define __USE_BSD
diff -ur aegis-4.25/common/config.messy.h aegis-4.25.try1/common/config.messy.h
--- aegis-4.25/common/config.messy.h    2012-12-04 03:03:31.000000000 +0100
+++ aegis-4.25/common/config.messy.h       2022-07-13 23:36:02.417981109 +0200
@@ -97,8 +97,10 @@
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
 #ifndef _BSD_SOURCE
 #define _BSD_SOURCE
+#ifndef _DEFAULT_SOURCE
+#define _DEFAULT_SOURCE
 #endif
 #endif

should do