[hackers] [dwm] config.mk: fix POSIX_C_SOURCE macro for feature test for snprintf() || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Fri, 3 Apr 2020 15:43:12 +0200 (CEST)

commit c82db690cc0c4624dad4dc6ae899020799ec84db
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Fri Apr 3 15:36:32 2020 +0200
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Fri Apr 3 15:36:32 2020 +0200

    config.mk: fix POSIX_C_SOURCE macro for feature test for snprintf()
    
    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.

diff --git a/config.mk b/config.mk
index 6d36cb7..7084c33 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -25,7 +25,7 @@ INCS = -I${X11INC} -I${FREETYPEINC}
 LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
 
 # flags
-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
 #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
 CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
 LDFLAGS = ${LIBS}
Received on Fri Apr 03 2020 - 15:43:12 CEST

This archive was generated by hypermail 2.3.0 : Fri Apr 03 2020 - 15:48:37 CEST