[commit: ghc] master: includes/Stg.h: define _DEFAULT_SOURCE for glibc-2.20 (c65221b)

git at git.haskell.org git at git.haskell.org
Wed Nov 12 23:36:07 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c65221bdbdebb0a6e615970cb0ca78abcb4202f8/ghc

>---------------------------------------------------------------

commit c65221bdbdebb0a6e615970cb0ca78abcb4202f8
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Wed Nov 12 23:18:38 2014 +0000

    includes/Stg.h: define _DEFAULT_SOURCE for glibc-2.20
    
    _BSD_SOURCE we are using for 'gamma()' and friends
    was deprecated in glibc-2.20 in favour of '_DEFAULT_SOURCE'.
    
    gcc says:
    
        In file included from /usr/include/math.h:26:0:
            0,
                             from includes/Stg.h:69,
                             from /tmp/ghc19488_0/ghc19488_2.hc:3:
    
        /usr/include/features.h:148:3:
             warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
             # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
               ^
    
    Patch fixes testsuite failures on UNREG
    (stderr are not cluttered by warnings anymore).
    
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>


>---------------------------------------------------------------

c65221bdbdebb0a6e615970cb0ca78abcb4202f8
 includes/Stg.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/includes/Stg.h b/includes/Stg.h
index 4c26e3e..f09fc00 100644
--- a/includes/Stg.h
+++ b/includes/Stg.h
@@ -47,6 +47,10 @@
 // We need _BSD_SOURCE so that math.h defines things like gamma
 // on Linux
 # define _BSD_SOURCE
+
+// '_BSD_SOURCE' is deprecated since glibc-2.20
+// in favour of '_DEFAULT_SOURCE'
+# define _DEFAULT_SOURCE
 #endif
 
 #if IN_STG_CODE == 0 || defined(llvm_CC_FLAVOR)



More information about the ghc-commits mailing list