Opened 3 years ago

Closed 2 years ago

#9185 closed bug (fixed)

glibc 2.20 outputs warnings for _BSD_SOURCE (Stg.h) on unknown archs

Reported by: juhpetersen Owned by: juhpetersen
Priority: normal Milestone: 7.10.1
Component: Compiler Version: 7.8.2
Keywords: Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Stg.h defines _BSD_SOURCE which glibc 2.20 deprecates with warnings in favour of _DEFAULT_SOURCE. Since the verbose warning is output for every ghc invocation when building it is rather annoying and induces testsuite failures.

The warning look like this:

In file included from /usr/include/math.h:26:0:
    0,
                     from /usr/lib64/ghc-7.6.3/include/Stg.h:65,
                     from /tmp/ghc783_0/ghc783_0.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"
       ^

Solution/workaround is to define "_DEFAULT_SOURCE" and that works.

I asked in https://bugzilla.redhat.com/show_bug.cgi?id=1067110#c13 about how best to fix Stg.h and got the answer to just add _DEFAULT_SOURCE.

Attachments (1)

0001-define-_DEFAULT_SOURCE-in-Stg.h-to-avoid-warnings-fr.patch (702 bytes) - added by juhpetersen 3 years ago.
proposed patch

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by juhpetersen

proposed patch

comment:1 Changed 3 years ago by juhpetersen

Owner: set to juhpetersen

comment:2 Changed 3 years ago by juhpetersen

Summary: glibc 2.20 outputs warnings for _BSD_SOURCE (Stg.h) on unknowns archsglibc 2.20 outputs warnings for _BSD_SOURCE (Stg.h) on unknown archs

comment:3 Changed 2 years ago by thomie

Status: newpatch

LGTM

comment:4 Changed 2 years ago by thoughtpolice

Milestone: 7.10.1
Resolution: fixed
Status: patchclosed

Hey Jens, sorry for taking so long. Sergei actually fixed this in c65221bdbdebb0a6e615970cb0ca78abcb4202f8, so this is now fixed. Thank you though (and sorry again!)

Note: See TracTickets for help on using tickets.