On Sun, Feb 17 2019, Ingo Feinerer <feine...@logic.at> wrote:
> On Sun, Feb 17, 2019 at 10:30:15AM +0100, Peter Hessler wrote:
>> On 2019 Feb 17 (Sun) at 09:56:39 +0100 (+0100), Ingo Feinerer wrote:
>> :On Sun, Feb 17, 2019 at 10:36:42AM +0200, Timo Myyrä wrote:
>> :> For some reason the compilation gives warning on pledge although unistd.h 
>> is included:
>> :> lemonbar.c:1541:9: warning: implicit declaration of function 'pledge' is 
>> invalid in C99 [-Wimplicit-function-declaration]
>> :>     if (pledge("stdio", NULL) == -1)
>> :>         ^
>> :> 1 warning generated.
>> :
>> :That is because of
>> :
>> :#define _POSIX_C_SOURCE 200809L
>> :
>> :in lemonbar.c
>> :
>> :pledge() still works (in my tests I tried the pledge() call at different
>> :earlier positions which lead to program termination) so I just ignored
>> :this warning.
>> 
>> No.  You need to make sure the proper prototype is declared for all
>> functions.
>
> New version attached which deletes the _POSIX_C_SOURCE #define.

Sounds fair.  An alternative would have been to also define _BSD_SOURCE.
Note that a pledge(2) failure ought to be fatal, I tweaked that in the
updated tarball attached.

> OK?

Updated version with amended pledge patch, PERMIT_PACKAGE=Yes and
a tweak to honor LDFLAGS.  I'm looking at this submission now because
Tom Murphy brought it up some days ago:

  https://marc.info/?l=openbsd-ports&m=157727376803891&w=2

Not tested but looks good ports-wise, ok jca@ to import

Attachment: lemonbar-xft.tgz
Description: Binary data

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to