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. -- In order to make an apple pie from scratch, you must first create the universe. -- Carl Sagan, Cosmos