diff --git a/src/ccall.cpp b/src/ccall.cpp index a7e8b0f4daa7c..89f20f18a770e 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -347,7 +347,7 @@ static bool is_native_simd_type(jl_datatype_t *dt) { #elif defined _CPU_PPC64_ typedef ABI_PPC64leLayout DefaultAbiState; #else -# warning "ccall is defaulting to llvm ABI, since no platform ABI has been defined for this CPU/OS combination" +# pragma message("ccall is defaulting to llvm ABI, since no platform ABI has been defined for this CPU/OS combination") typedef ABI_LLVMLayout DefaultAbiState; #endif diff --git a/src/cgutils.cpp b/src/cgutils.cpp index 39af20a47a7df..23eb19f65c9a6 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -3340,7 +3340,7 @@ static jl_cgval_t emit_setfield(jl_codectx_t &ctx, Value *ptindex = ctx.builder.CreateInBoundsGEP(getInt8Ty(ctx.builder.getContext()), emit_bitcast(ctx, maybe_decay_tracked(ctx, addr), getInt8PtrTy(ctx.builder.getContext())), ConstantInt::get(getSizeTy(ctx.builder.getContext()), fsz)); if (needlock) emit_lockstate_value(ctx, strct, true); - BasicBlock *ModifyBB; + BasicBlock *ModifyBB = NULL; if (ismodifyfield) { ModifyBB = BasicBlock::Create(ctx.builder.getContext(), "modify_xchg", ctx.f); ctx.builder.CreateBr(ModifyBB); diff --git a/src/crc32c.c b/src/crc32c.c index 1e57d8aef85db..11b71b5061ede 100644 --- a/src/crc32c.c +++ b/src/crc32c.c @@ -346,7 +346,7 @@ static crc32c_func_t crc32c_dispatch(unsigned long hwcap) # define crc32c_dispatch() crc32c_dispatch(getauxval(AT_HWCAP)) # define crc32c_dispatch_ifunc "crc32c_dispatch" # else -# warning CRC32 feature detection not implemented for this OS. Falling back to software version. +# pragma message("CRC32 feature detection not implemented for this OS. Falling back to software version.") # endif #else // If we don't have any accelerated version to define, just make the _sw version define diff --git a/src/dlload.c b/src/dlload.c index 33afe62acad90..b7c2bcd36a3db 100644 --- a/src/dlload.c +++ b/src/dlload.c @@ -159,6 +159,7 @@ JL_DLLEXPORT void *jl_load_dynamic_library(const char *modname, unsigned flags, // number of extensions to try — if modname already ends with the // standard extension, then we don't try adding additional extensions int n_extensions = endswith_extension(modname) ? 1 : N_EXTENSIONS; + int ret; /* this branch returns handle of libjulia-internal @@ -228,8 +229,12 @@ JL_DLLEXPORT void *jl_load_dynamic_library(const char *modname, unsigned flags, path[0] = '\0'; if (relocated[len-1] == PATHSEPSTRING[0]) snprintf(path, PATHBUF, "%s%s%s", relocated, modname, ext); - else - snprintf(path, PATHBUF, "%s" PATHSEPSTRING "%s%s", relocated, modname, ext); + else { + ret = snprintf(path, PATHBUF, "%s" PATHSEPSTRING "%s%s", relocated, modname, ext); + if (ret < 0) + jl_errorf("path is longer than %d\n", PATHBUF); + } + #ifdef _OS_WINDOWS_ if (i == 0) { // LoadLibrary already tested the extensions, we just need to check the `stat` result #endif @@ -299,7 +304,7 @@ JL_DLLEXPORT int jl_dlsym(void *handle, const char *symbol, void ** value, int t */ symbol_found = *value != NULL; #ifndef _OS_WINDOWS_ - const char *err; + const char *err = ""; if (!symbol_found) { dlerror(); /* Reset error status. */ *value = dlsym(handle, symbol); diff --git a/src/dump.c b/src/dump.c index accc3bfb4916f..dd3e065cefc36 100644 --- a/src/dump.c +++ b/src/dump.c @@ -1071,6 +1071,7 @@ static void serialize_htable_keys(jl_serializer_state *s, htable_t *ht, int nite write_int32(s->s, nitems); void **table = ht->table; size_t i, n = 0, sz = ht->size; + (void)n; for (i = 0; i < sz; i += 2) { if (table[i+1] != HT_NOTFOUND) { jl_serialize_value(s, (jl_value_t*)table[i]); diff --git a/src/gc-debug.c b/src/gc-debug.c index 6363512ae2c01..4e60aab3b0545 100644 --- a/src/gc-debug.c +++ b/src/gc-debug.c @@ -983,13 +983,13 @@ void gc_time_summary(int sweep_full, uint64_t start, uint64_t end, uint64_t pause) { if (sweep_full > 0) - jl_safe_printf("%ld Major collection: estimate freed = %ld - live = %ldm new interval = %ldm time = %ldms\n", + jl_safe_printf("%ld Major collection: estimate freed = %ld\n" + "live = %ldm new interval = %ldm time = %ldms\n", end - start, freed, live/1024/1024, interval/1024/1024, pause/1000000 ); else - jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm - new interval = %ldm time = %ldms\n", + jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm\n" + "new interval = %ldm time = %ldms\n", end - start, freed, live/1024/1024, interval/1024/1024, pause/1000000 ); } diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp index 231b37778eae5..dd821e8570be7 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -1118,7 +1118,7 @@ StringRef JuliaOJIT::getFunctionAtAddress(uint64_t Addr, jl_code_instance_t *cod #ifdef JL_USE_JITLINK # if JL_LLVM_VERSION < 140000 -# warning "JIT debugging (GDB integration) not available on LLVM < 14.0 (for JITLink)" +# pragma message("JIT debugging (GDB integration) not available on LLVM < 14.0 (for JITLink)") void JuliaOJIT::enableJITDebuggingSupport() {} # else extern "C" orc::shared::CWrapperFunctionResult diff --git a/src/jitlayers.h b/src/jitlayers.h index 035e81bead88d..029db8e8094e0 100644 --- a/src/jitlayers.h +++ b/src/jitlayers.h @@ -32,7 +32,7 @@ // for Mac/aarch64. #if defined(_OS_DARWIN_) && defined(_CPU_AARCH64_) # if JL_LLVM_VERSION < 130000 -# warning "On aarch64-darwin, LLVM version >= 13 is required for JITLink; fallback suffers from occasional segfaults" +# pragma message("On aarch64-darwin, LLVM version >= 13 is required for JITLink; fallback suffers from occasional segfaults") # endif # define JL_USE_JITLINK #endif