]> git.mdlowis.com Git - projs/tide.git/commitdiff
added pragmas so I can start erroring on unused functions in C files but ignore the...
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 10 Dec 2018 20:49:14 +0000 (15:49 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 10 Dec 2018 20:49:14 +0000 (15:49 -0500)
config.h
config.mk
inc/stdc.h
inc/vec.h
inc/x11.h
src/tide.c

index bb36a1edbca4092354339a7ee4bd96c7ff04acaf..3e71db8ee0b4b513e479eb1b81f3e55f1b46fff4 100644 (file)
--- a/config.h
+++ b/config.h
@@ -18,7 +18,7 @@ enum { /* Color Names */
 #define CMD_GOTO_TAG "!picktag fetch tags"
 
 /* Command used to open file in editor at a given line */
-static char* EditCmd[] = (char*[]){ "tide", "-l", 0, 0, 0 };
+static char* EditCmd[] = { "tide", "-l", 0, 0, 0 };
 
 /* The shell: Filled in with $SHELL. Used to execute commands */
 static char* ShellCmd[] = { 0, "-c", 0, 0 };
@@ -132,4 +132,3 @@ Rule* BuiltinRules[] = {
 #endif
 
 #pragma GCC diagnostic pop
-
index dde9951dd29eba143945ec75b005252f25a6668b..6c8014528980a61f3b05cbda44effd6441eb2bf9 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -1,7 +1,7 @@
 # Customize this file to fit your system
 
 # number of threads/cores to use
-MAKEFLAGS = -j4
+MAKEFLAGS += -j
 
 # Install location
 #PREFIX = $(HOME)
@@ -18,9 +18,9 @@ INCS += -I/usr/include/freetype2
 
 # Compiler Setup
 CC = cc
-CFLAGS  = -g --std=c99 -MMD $(INCS)
+CFLAGS  = -g -MMD $(INCS)
+CFLAGS += --std=c99 -pedantic
 CFLAGS += -Wall -Wextra
-CFLAGS += -Wno-unused-function
 CFLAGS += -Werror
 
 # Linker Setup
index 5ff68d613ffbfc5c1f8b165f6fd175c6022fb76e..d42b1df5ddefaa12e40f8e4c0e03a0e20781622e 100644 (file)
@@ -19,6 +19,9 @@
 #include <stdarg.h>
 #include <string.h>
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 static char* strmcat(char* first, ...) {
     va_list args;
     /* calculate the length of the final string */
@@ -198,3 +201,5 @@ static inline char* _getopt_(int* p_argc, char*** p_argv) {
     #define max(x,y) \
         ((x) > (y) ? (x) : (y))
 #endif
+
+#pragma GCC diagnostic pop
index c7b61138b7fe181c8d03f7a6692265d0e6770d79..ca85701c2bf86d5dac8fe617215ccf364e190925 100644 (file)
--- a/inc/vec.h
+++ b/inc/vec.h
@@ -12,6 +12,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 typedef struct {
     size_t   elem_count;
     size_t   elem_size;
@@ -117,4 +120,6 @@ static void vec_sort(vec_t* vec, int (*cmpfn)(const void*,const void*)) {
     qsort(vec->elem_buffer, vec->elem_count, vec->elem_size, cmpfn);
 }
 
+#pragma GCC diagnostic pop
+
 #endif /* VEC_H */
index 87ed33392518c3d85c7cf69b884165089763919a..9ea4835ea6a7a31d04dc219d4def32299c48efb4 100644 (file)
--- a/inc/x11.h
+++ b/inc/x11.h
@@ -6,6 +6,9 @@
 #include <signal.h>
 #include <locale.h>
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 typedef struct XConf {
     int fd, screen, width, height;
     Window root;
@@ -87,3 +90,5 @@ static void x11_event_loop(XConf* x) {
         for (int status; waitpid(-1, &status, WNOHANG) > 0;);
     }
 }
+
+#pragma GCC diagnostic pop
index ab665290ec1be9a4234b0e379e60ddb5da1d5d2e..d9b684393c6f25bc6aa0dd5348fe24becd6447e6 100644 (file)
@@ -13,7 +13,7 @@ typedef struct {
 } Tag;
 
 char* ARGV0;
-static Tag Builtins[];
+static Tag Builtins[16];
 
 /* Tag/Cmd Execution
  ******************************************************************************/
@@ -412,7 +412,7 @@ static void lnexec(char* cmd) {
 
 /* Main Routine
  ******************************************************************************/
-static Tag Builtins[] = {
+static Tag Builtins[16] = {
     { .tag = "Cut",    .action = cut       },
     { .tag = "Copy",   .action = copy      },
     { .tag = "Del",    .action = quit      },