bjking1 / iprutils

The iprutils package is a RAID configuration utility to manage SAS RAID adapters on IBM Power Linux
Other
8 stars 9 forks source link

configure.ac: add AC_USE_SYSTEM_EXTENSIONS #4

Closed ffontaine closed 3 years ago

ffontaine commented 4 years ago

uint and alphasort come from glibc, and with ancient versions thereof, they were guarded behind different sets of feature-test macros (see manpage for scandir() for example), which were not default back then.

In file included from iprdump.c:17:0:
iprlib.h:1866:2: error: unknown type name 'uint'
  uint supported_with_min_ucode_level;
  ^

iprlib.c: In function 'ipr_get_pci_slots':
iprlib.c:1999:48: error: 'alphasort' undeclared (first use in this function)
  num_slots = scandir(rootslot, &slotdir, NULL, alphasort);
                                                ^

Fix them by adding AC_USE_SYSTEM_EXTENSIONS in configure.ac

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com Signed-off-by: Yann E. MORIN yann.morin.1998@free.fr

yann-morin-1998 commented 4 years ago

Technically, the issue is not with gcc, but with glibc.

uint and alphasort come from glibc, and with ancient versions thereof, they were guarded behind different sets of feature-test macros (see manpage for scandir() for example), which were not default back then.

And for reference: the failing test-case was using glibc-2.18, while the feature-test for alphasort() changed with glibc-2.19.

ffontaine commented 4 years ago

Thanks Yann, I updated the PR accordingly