gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] strl{cat,cpy} prototypes in gps.h always active


From: Michael Weiser
Subject: [gpsd-dev] strl{cat,cpy} prototypes in gps.h always active
Date: Mon, 22 Dec 2014 21:57:43 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

Hi,

compiling gpsd on Mac OS X blows up with a horrid and misleading
sequence of errors such as this:

./gps.h:2117:8: error: expected parameter declarator
size_t strlcat(/address@hidden@*/char *dst, /address@hidden@*/const char *src, 
size_t size);
       ^
/usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
                                           ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL 
> 1 ? 1 : 0)
                                                             ^
/usr/include/secure/_common.h:30:32: note: expanded from macro 
'_USE_FORTIFY_LEVEL'
#    define _USE_FORTIFY_LEVEL 2
                               ^
In file included from gpsclient.c:10:
./gps.h:2117:8: error: expected ')'

There seems to be a conflict between OS X'es prototype for strl{cat,cpy}
and the replacements gpsd supplies.

That said, since OS X provides strl{cat,cpy}, shouldn't those
replacements be inactive? And indeed, scons detects and reports as
expected:

Checking for C function strlcpy()... (cached) yes
Checking for C function strlcat()... (cached) yes

And gpsd.h and gpsd_config.h both have:

had.h:#define HAVE_STRLCPY 1
gpsd.h:#define HAVE_STRLCAT 1
gpsd_config.h:#define HAVE_STRLCPY 1
gpsd_config.h:#define HAVE_STRLCAT 1

But gps.h includes neither, leaving HAVE_STRL{CPY,CAT} undefined and in
turn the replacements' prototypes enabled. This would be the case on any
platform but OS X seems to be the first where there's enough difference
to cause issues.

As to be expected, including gpsd_config.h in gps.h fixes the compile.
No idea if this is the correct way to go about fixing this. Patch
attached for your convenience anyway. :)
-- 
bye, Michael

Attachment: 0001-Fix-strl-cat-cpy-prototype-activation.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]