mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
Cleanups and make compile with clang again with no warnings.
This commit is contained in:
parent
7d2a2f2ade
commit
fa401b6f56
6 changed files with 16 additions and 11 deletions
4
Makefile
4
Makefile
|
@ -19,7 +19,9 @@ ifeq ($(CC), clang)
|
|||
-Wno-format-nonliteral \
|
||||
-Wno-disabled-macro-expansion \
|
||||
-Wno-conversion \
|
||||
-Wno-missing-prototypes
|
||||
-Wno-missing-prototypes \
|
||||
-Wno-float-equal \
|
||||
-Wno-cast-align
|
||||
endif
|
||||
ifeq ($(track), no)
|
||||
CFLAGS += -DNOTRACK
|
||||
|
|
1
ast.c
1
ast.c
|
@ -1085,7 +1085,6 @@ void _ast_codegen_output_type(ast_expression_common *self, ir_value *out)
|
|||
}
|
||||
|
||||
#define codegen_output_type(a,o) (_ast_codegen_output_type(&((a)->expression),(o)))
|
||||
#define codegen_output_type_expr(a,o) (_ast_codegen_output_type(a,(o)))
|
||||
|
||||
bool ast_value_codegen(ast_value *self, ast_function *func, bool lvalue, ir_value **out)
|
||||
{
|
||||
|
|
4
exec.c
4
exec.c
|
@ -560,28 +560,24 @@ bool prog_exec(qc_program *prog, prog_section_function *func, size_t flags, long
|
|||
#define QCVM_PROFILE 0
|
||||
#define QCVM_TRACE 0
|
||||
# include __FILE__
|
||||
break;
|
||||
}
|
||||
case (VMXF_TRACE):
|
||||
{
|
||||
#define QCVM_PROFILE 0
|
||||
#define QCVM_TRACE 1
|
||||
# include __FILE__
|
||||
break;
|
||||
}
|
||||
case (VMXF_PROFILE):
|
||||
{
|
||||
#define QCVM_PROFILE 1
|
||||
#define QCVM_TRACE 0
|
||||
# include __FILE__
|
||||
break;
|
||||
}
|
||||
case (VMXF_TRACE|VMXF_PROFILE):
|
||||
{
|
||||
#define QCVM_PROFILE 1
|
||||
#define QCVM_TRACE 1
|
||||
# include __FILE__
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
2
main.c
2
main.c
|
@ -206,8 +206,6 @@ static bool options_parse(int argc, char **argv) {
|
|||
|
||||
/* show defaults (like pathscale) */
|
||||
if (!strcmp(argv[0]+1, "show-defaults")) {
|
||||
size_t itr;
|
||||
char buffer[1024];
|
||||
for (itr = 0; itr < COUNT_FLAGS; ++itr) {
|
||||
if (!OPTS_FLAG(itr))
|
||||
continue;
|
||||
|
|
3
parser.c
3
parser.c
|
@ -26,8 +26,6 @@
|
|||
#include "gmqcc.h"
|
||||
#include "lexer.h"
|
||||
|
||||
#define PARSER_HT_FIELDS 0
|
||||
#define PARSER_HT_GLOBALS 1
|
||||
/* beginning of locals */
|
||||
#define PARSER_HT_LOCALS 2
|
||||
|
||||
|
@ -4375,7 +4373,6 @@ skipvar:
|
|||
}
|
||||
else if (parser->tok == '{' || parser->tok == '[')
|
||||
{
|
||||
size_t i;
|
||||
if (localblock) {
|
||||
parseerror(parser, "cannot declare functions within functions");
|
||||
break;
|
||||
|
|
13
test.c
13
test.c
|
@ -127,8 +127,21 @@ FILE ** task_popen(const char *command, const char *mode) {
|
|||
goto task_popen_error_3;
|
||||
}
|
||||
|
||||
/*
|
||||
* clang is stupid, it doesn't understand that yes, this code
|
||||
* is actually reachable.
|
||||
*/
|
||||
# ifdef __clang__
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wunreachable-code"
|
||||
# endif
|
||||
if (argv)
|
||||
vec_free(argv);
|
||||
|
||||
# ifdef __clang__
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
|
||||
return data->handles;
|
||||
|
||||
task_popen_error_3: close(errhandle[0]), close(errhandle[1]);
|
||||
|
|
Loading…
Reference in a new issue