Skip to content

Commit

Permalink
Define _DEFAULT_SOURCE instead of _BSD_SOURCE
Browse files Browse the repository at this point in the history
Glibc feature macro _BSD_SOURCE is deprecated in favour of
_DEFAULT_SOURCE since glibc-2.20:

In file included from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/limits.h:26,
                 from /usr/lib/gcc/x86_64-redhat-linux/14/include/limits.h:210,
                 from /usr/lib/gcc/x86_64-redhat-linux/14/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/14/include/limits.h:34,
                 from /usr/lib64/glib-2.0/include/glibconfig.h:11,
                 from /usr/include/glib-2.0/glib/gtypes.h:34,
                 from /usr/include/glib-2.0/glib/galloca.h:34,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /home/test/librepo/librepo/handle.c:24:
/usr/include/features.h:197:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  197 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~

This patch adds _DEFAULT_SOURCE definition to do it like
librepo/downloader.c aleady does. (Though replacing _BSD_SOURCE would
do it even on RHEL 8 where glibc is newer than 2.20.)
  • Loading branch information
ppisar authored and kontura committed Mar 7, 2024
1 parent a788f57 commit 4be343c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions librepo/handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#define _POSIX_C_SOURCE 200809L
#define _BSD_SOURCE
#define _DEFAULT_SOURCE

#include <glib.h>
#include <errno.h>
Expand Down

0 comments on commit 4be343c

Please sign in to comment.