Mir

mir examples/progressbar.c uses internal C define (can't build on other distros)

Bug #1384390 reported by Allison Karlitskaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Fix Released
Medium
Allison Karlitskaya
mir (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

This example program does #define __USE_BSD 1 but the __USE_BSD macro is an internal private define for use by the C library itself. This causes problems with newer versions of glibc.

The correct solution here is to use _BSD_SOURCE but apparently this is deprecated in newer versions of glibc for favour of _DEFAULT_SOURCE.

In order to work with both old and new we should define both as explained here:

/* _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. */
#if (defined _BSD_SOURCE || defined _SVID_SOURCE) \
    && !defined _DEFAULT_SOURCE
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
# undef _DEFAULT_SOURCE
# define _DEFAULT_SOURCE 1
#endif

Related branches

Changed in mir:
milestone: none → 0.9.0
assignee: nobody → Ryan Lortie (desrt)
status: New → In Progress
summary: - mir examples/progressbar.c uses internal C define
+ mir examples/progressbar.c uses internal C define (can't build on other
+ distros)
Changed in mir:
importance: Undecided → Medium
tags: added: portability
Revision history for this message
Allison Karlitskaya (desrt) wrote :

fwiw this is fairly low priority for me -- both this and the gflags bugs are now being vendor-patched by jhbuild for now.

tags: added: gtk-mir
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.9.0

Changed in mir:
status: In Progress → Fix Committed
Changed in mir (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in mir:
status: Fix Committed → Fix Released
Changed in mir (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.