Anonymous avatar Anonymous committed e89861c

Make the build spew warnings.

Comments (0)

Files changed (9)

 CC?=gcc
 
+WARNS=	-W -Wall -Wstrict-prototypes -Wmissing-prototypes \
+	-Wpointer-arith	-Wno-uninitialized -Wreturn-type -Wcast-qual \
+	-Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wchar-subscripts \
+	-Winline -Wnested-externs -Wredundant-decls
+
 #CFLAGS+=-DNO_AR_STACK
 #CFLAGS+=-DPOOL_VALUES 
 CFLAGS+=-DHASH_CONSING
 CFLAGS+=-DINLINE_BUILTINS
-CFLAGS+=-Wall -ansi
+CFLAGS+=-DHAS_WCHAR_PREDS
+
+ifdef ANSI
+  CFLAGS+= -ansi -pedantic
+else
+  CFLAGS+= -std=c99 -D_POSIX_C_SOURCE=200112L
+endif
+
+CFLAGS+= ${WARNS} ${EXTRA_CFLAGS}
 
 #CFLAGS+=-g -DDEBUG
 CFLAGS+=-DNDEBUG
 		return("AST_RETR");
 	}
 #endif
-	return("AST_UNKNOWN??!?");
+	return("AST_UNKNOWN?");
 }
 
 void

src/lib/builtin.h

 struct symbol_table;
 
 struct builtin {
-	wchar_t *name;
+	const wchar_t *name;
 	struct value (*fn)(struct activation *);
 	struct type *(*ty)(void);
 	int arity;
 
 int maxlevel = 3;
 
-wchar_t *op[4][9] = {
+const wchar_t *op[4][9] = {
 	{ L"&", L"|",  L"",  L"",  L"",   L"",   L"",       L"",       L""       },
 	{ L"=", L"!=", L">", L"<", L">=", L"<=", L"\x2264", L"\x2265", L"\x2260" },
 	{ L"+", L"-",  L"",  L"",  L"",   L"",   L"",       L"",       L""       },
 }
 
 void
-report(int rtype, struct scan_st *sc, char *fmt, ...)
+report(int rtype, struct scan_st *sc, const char *fmt, ...)
 {
 	va_list args;
 	int i;
 extern void	report_start(void);
 extern int	report_finish(void);
 
-extern void	report(int, struct scan_st *, char *, ...);
+extern void	report(int, struct scan_st *, const char *, ...);
 
 #endif /* !__SCAN_H_ */
 #include <assert.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "mem.h"
 #include "type.h"
 }
 
 struct value
-value_new_error(char *error)
+value_new_error(const char *error)
 {
 	struct value v;
 
 
 struct value	value_new_string(wchar_t *);
 struct value	value_new_list(void);
-struct value	value_new_error(char *);
+struct value	value_new_error(const char *);
 struct value	value_new_builtin(struct builtin *);
 struct value	value_new_closure(struct ast *, struct activation *, int, int, int);
 struct value	value_new_dict(void);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.