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