config.mk: fix POSIX_C_SOURCE macro for feature test for snprintf() c82db690
The feature test was incorrect:
_POSIX_C_SOURCE=2

"The value 2 or greater additionally exposes definitions for POSIX.2-1992."
http://man7.org/linux/man-pages/man7/feature_test_macros.7.html

A higher value is needed (atleast 1995):
https://pubs.opengroup.org/onlinepubs/9699919799/functions/snprintf.html

FreeBSD feature test macro:
on
https://github.com/freebsd/freebsd/blob/master/include/stdio.h line 297

This was already fixed in dmenu.

This fixes a warning on FreeBSD, reported by Plasmoduck on IRC, thanks.
Hiltjo Posthuma · 2020-04-03 15:36 1 file(s) · +1 −1
config.mk +1 −1
25 25
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
26 26
27 27
# flags
28 -
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
28 +
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
29 29
#CFLAGS   = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
30 30
CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
31 31
LDFLAGS  = ${LIBS}