]> granicus.if.org Git - fortune-mod/commitdiff
Get rid of clang warnings by deprct bsd-regex
authorShlomi Fish <shlomif@shlomifish.org>
Tue, 26 Dec 2017 18:20:09 +0000 (20:20 +0200)
committerShlomi Fish <shlomif@shlomifish.org>
Tue, 26 Dec 2017 18:20:09 +0000 (20:20 +0200)
man page says they are obsolete.

fortune-mod/CMakeLists.txt
fortune-mod/fortune/fortune.c

index 9ca8e54530c93509ae3bd9cca52a1289bf74e157..af5c743bf6c8cc170ef43edbf5e4f293e361f1e2 100644 (file)
@@ -94,6 +94,10 @@ SET (OCOOKIEDIR "${COOKIEDIR}/off" CACHE STRING "offensive cookie dir not under
 
 SHLOMIF_ADD_COMMON_C_FLAGS()
 
+add_flags("-Weverything" "-Wno-language-extension-token" "-Wno-padded")
+
+SHLOMIF_FINALIZE_FLAGS()
+
 INCLUDE(CheckIncludeFile)
 SET(_r "stdbool.h" "stdio.h" "recode.h")
 CHECK_INCLUDE_FILES("${_r}" HAVE_RECODE_H)
@@ -171,7 +175,7 @@ CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H)
 
 IF ("${HAVE_REGEX_H}")
     ADD_DEFINITIONS("-DHAVE_REGEX_H")
-    ADD_DEFINITIONS("-DBSD_REGEX")
+    ADD_DEFINITIONS("-DPOSIX_REGEX")
 ENDIF()
 
 ADD_DEFINITIONS("-DHAVE_STDBOOL")
index d5d30fce8b7b9e62dc9929d998dfe1acc430d8f4..7fcbf21b269914984aa33325386ef8788d2121f2 100644 (file)
@@ -121,11 +121,6 @@ static char rcsid[] = "$NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $";
 #include        <recode.h>
 
 
-/* This makes GNU libc to prototype the BSD regex functions */
-#ifdef BSD_REGEX
-#define _REGEX_RE_COMP
-#endif
-
 #ifdef HAVE_REGEX_H
 #include        <regex.h>
 #endif
@@ -150,10 +145,8 @@ static char rcsid[] = "$NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $";
 
 #ifdef DEBUG
 #define DPRINTF(l,x)    if (Debug >= l) fprintf x;
-#undef          NDEBUG
 #else
 #define DPRINTF(l,x)
-#define NDEBUG  1
 #endif
 
 typedef struct fd
@@ -212,14 +205,6 @@ static FILEDESC *Fortfile;             /* Fortune file to use */
 
 static STRFILE Noprob_tbl;             /* sum of data for all no prob files */
 
-#ifdef BSD_REGEX
-
-#define RE_COMP(p)      re_comp(p)
-#define BAD_COMP(f)     ((f) != NULL)
-#define RE_EXEC(p)      re_exec(p)
-
-#else
-
 #ifdef POSIX_REGEX
 #define RE_COMP(p)      regcomp(&Re_pat, (p), REG_NOSUB)
 #define BAD_COMP(f)     ((f) != 0)
@@ -230,8 +215,6 @@ static regex_t Re_pat;
 #define NO_REGEX
 #endif /* POSIX_REGEX */
 
-#endif /* BSD_REGEX */
-
 static RECODE_REQUEST request;
 static RECODE_OUTER outer;