From 91dae272cda9730c4e7def54e2498258cff9c721 Mon Sep 17 00:00:00 2001 From: Fabrizio Fabbri Date: Sat, 25 Feb 2017 02:39:28 +0100 Subject: [PATCH 1/2] fix #363 make check fail with "Odd number of keys." --- src/lsp/process.lsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lsp/process.lsp b/src/lsp/process.lsp index 14381a6f7..88456c3c0 100644 --- a/src/lsp/process.lsp +++ b/src/lsp/process.lsp @@ -44,7 +44,7 @@ option "/c"))) (nth-value 1 (run-program shell (list option cmd-string) :wait t :output nil :input nil :error nil - #+windows :escape-arguments nil)))) + #+windows :escape-arguments #+windows nil)))) ;;; ;;; Wrapper around si_run_program call. Thanks to that C interface From f0ae1b2d63f5f28ec127c6d90636c5d41d8aaf3d Mon Sep 17 00:00:00 2001 From: Fabrizio Fabbri Date: Sat, 25 Feb 2017 02:40:03 +0100 Subject: [PATCH 2/2] Reduce warning with clang compiler. --- src/c/dpp.c | 10 +++++++++- src/c/file.d | 10 +++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/c/dpp.c b/src/c/dpp.c index ec3bd7833..6d8948d9f 100755 --- a/src/c/dpp.c +++ b/src/c/dpp.c @@ -668,7 +668,15 @@ put_declaration(void) put_lineno(); the_env_defined = 1; - fprintf(out, "\tconst cl_env_ptr the_env = ecl_process_env();\n"); + fprintf(out, + "#ifdef __clang__\n" + "#pragma clang diagnostic push\n" + "#pragma clang diagnostic ignored \"-Wunused-variable\"\n" + "#endif\n" + "\tconst cl_env_ptr the_env = ecl_process_env();\n" + "#ifdef __clang__\n" + "#pragma clang diagnostic pop\n" + "#endif\n" ); for (i = 0; i < nopt; i++) { put_lineno(); fprintf(out, "\tcl_object %s;\n", optional[i].o_var); diff --git a/src/c/file.d b/src/c/file.d index 1f3bbdd5e..4d28b1e9a 100755 --- a/src/c/file.d +++ b/src/c/file.d @@ -1099,10 +1099,8 @@ utf_8_decoder(cl_object stream) static int utf_8_encoder(cl_object stream, unsigned char *buffer, ecl_character c) { - int nbytes; - if (c < 0) { - nbytes = 0; - } else if (c <= 0x7F) { + int nbytes = 0; + if (c <= 0x7F) { buffer[0] = c; nbytes = 1; } else if (c <= 0x7ff) { @@ -2784,10 +2782,12 @@ io_file_get_position(cl_object strm) offset = lseek(f, 0, SEEK_CUR); ecl_enable_interrupts(); unlikely_if (offset < 0) + { if (errno == ESPIPE) return(ECL_NIL); else io_error(strm); + } if (sizeof(ecl_off_t) == sizeof(long)) { output = ecl_make_integer(offset); } else { @@ -5126,7 +5126,7 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, FEerror("Illegal stream mode ~S", 1, ecl_make_fixnum(smm)); } if (flags & ECL_STREAM_C_STREAM) { - FILE *fp; + FILE *fp = 0; safe_close(f); /* We do not use fdopen() because Windows seems to * have problems with the resulting streams. Furthermore, even for