mir examples/progressbar.c uses internal C define (can't build on other distros)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
Medium
|
desrt | ||
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
- PS Jenkins bot (community): Approve (continuous-integration)
- Kevin DuBois (community): Approve
- Daniel van Vugt: Approve
-
Diff: 18 lines (+3/-1)1 file modifiedexamples/progressbar.c (+3/-1)
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 |
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 |
fwiw this is fairly low priority for me -- both this and the gflags bugs are now being vendor-patched by jhbuild for now.