diff --git a/src/builtins/fold.c b/src/builtins/fold.c index ff8f35e8..bc4a0e99 100644 --- a/src/builtins/fold.c +++ b/src/builtins/fold.c @@ -105,7 +105,7 @@ B sum_c1(B t, B x) { // Try to keep to i32 product, go to f64 on overflow or non-i32 initial #define DEF_INT_PROD(T) \ static NOINLINE f64 prod_##T(void* xv, usz i, f64 init) { \ - while (i--) init*=((T*)xv)[i]; return init; \ + while (i--) { init*=((T*)xv)[i]; } return init; \ } \ static f64 prod_int_##T(void* xv, usz ia, i32 init) { \ T* xp = xv; \ diff --git a/src/builtins/md1.c b/src/builtins/md1.c index e5f9e5ed..5f0eea6e 100644 --- a/src/builtins/md1.c +++ b/src/builtins/md1.c @@ -1,3 +1,6 @@ +#if defined(__GNUC__) && !defined(__clang__) // have to do this at the very top because diagnostic ignoring works based on the callee location, not caller + #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif #include "../core.h" #include "../utils/each.h" #include "../utils/file.h" @@ -144,6 +147,10 @@ static B m1c2(B t, B f, B w, B x) { // consumes w,x return r; } +#pragma GCC diagnostic push +#ifdef __clang__ + #pragma GCC diagnostic ignored "-Wsometimes-uninitialized" +#endif #define S_SLICES(X) \ BSS2A X##_slc = TI(X,slice); \ usz X##_csz = 1; \ @@ -152,7 +159,7 @@ static B m1c2(B t, B f, B w, B x) { // consumes w,x if (X##_cr>1) { \ X##_csh = m_shArr(X##_cr); \ PLAINLOOP for (usz i = 0; i < X##_cr; i++) { \ - usz v = SH(X)[i+1]; \ + usz v = SH(X)[i+1]; \ X##_csz*= v; \ X##_csh->a[i] = v; \ } \ @@ -162,11 +169,6 @@ static B m1c2(B t, B f, B w, B x) { // consumes w,x #define E_SLICES(X) if (X##_cr>1) ptr_dec(X##_csh); decG(X); -#pragma GCC diagnostic push -#ifdef __clang__ - #pragma GCC diagnostic ignored "-Wsometimes-uninitialized" - // no gcc case because gcc is gcc and does gcc things instead of doing what it's asked to do -#endif extern B to_fill_cell_k(B x, ur k, char* err); // from md2.c static B to_fill_cell_1(B x) { // consumes x diff --git a/src/clangdCommands.bqn b/src/clangdCommands.bqn index 840da98a..f9e67cb4 100644 --- a/src/clangdCommands.bqn +++ b/src/clangdCommands.bqn @@ -7,7 +7,7 @@ allFiles ← ⟨⟩ allFiles {⊑(<¯2↑𝕩)∊".c"‿".h"}¨⊸/↩ initialFlags ← ⟨ - "/usr/bin/clang","-std=gnu11","-Wall","-DCLANGD","-fms-extensions" + "/usr/bin/clang","-std=gnu11","-Wall","-DCLANGD","-DFFI=2","-DCBQN_EXPORT","-fms-extensions" "-Wno-microsoft-anon-tag","-Wno-unused-function","-Wno-undefined-internal","-Wno-bitwise-instead-of-logical","-Wno-unknown-warning-option" ⟩ ∾ additionalFlags ∾ enableSingeli/⟨"-DSINGELI","-march=native"⟩ diff --git a/src/singeli/src/select.singeli b/src/singeli/src/select.singeli index d4a6635e..5a5f33f7 100644 --- a/src/singeli/src/select.singeli +++ b/src/singeli/src/select.singeli @@ -13,12 +13,12 @@ oper &~ andnot infix none 35 # b:B - pointer to data to index; if width{B}