[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] ✘gpsd build broken with glibc 2.23
From: |
Gary E. Miller |
Subject: |
Re: [gpsd-dev] ✘gpsd build broken with glibc 2.23 |
Date: |
Fri, 15 Apr 2016 18:07:28 -0700 |
Yo Fred!
On Fri, 15 Apr 2016 16:12:58 -0700 (PDT)
Fred Wright <address@hidden> wrote:
> > Ideas anyone? Doe my patch break any prior versions?
>
> It seems unlikely that a change in a file that wasn't previously
> included is responsible for the trouble. :-)
Nor did I suggest so.
> It appears that features.h (included by sys/types.h) defines
> __USE_BSD if _BSD_SOURCE is defined, and that that in turn causes
> sysmacros.h to be included by sys/types.h. But one has to be careful
> to define any feature test options before *any* includes, not just
> the one(s) of interest.
In theory, but fails in practice:
-#include <sys/types.h>
+#define _BSD_SOURCE 1
+#include <sys/types.h> /* defines major() */
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <stdio.h>
from serial.c:7:
/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"
serial.c: In function 'gpsd_classify':
serial.c:69:17: warning: implicit declaration of function 'major'
[-Wimplicit-function-declaration]
int devmajor = major(sb.st_rdev);
^
Looks like _BSD_SOURCE is gone after glibc 2.19.
It got replaced by _DEFAULT_SOURCE, but that also fails the same way:
-#include <sys/types.h>
+#define _DEFAULT_SOURCE 1
+#include <sys/types.h> /* defines major() */
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <stdio.h>
At least my patch actually worked. :-)
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
address@hidden Tel:+1 541 382 8588
pgpJBVs7lKW8b.pgp
Description: OpenPGP digital signature