From 5308efac5d60290a54db6123e95222669e40bc7e Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Wed, 28 Jan 2026 14:22:02 -0500 Subject: [PATCH] Fix warnings --- .github/workflows/main.yml | 6 +++++- gcc/jit/jit-recording.cc | 2 +- gcc/jit/jit-recording.h | 12 ++++++------ gcc/jit/libgccjit.cc | 5 ++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89a80a6ca6e65..ff3df4235301d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,11 @@ jobs: mkdir build install cd build ../gcc/configure --enable-host-shared --enable-languages=c,jit,lto --disable-bootstrap --disable-multilib --prefix=/usr - make -j4 + bash -o pipefail -c 'make -j4 2>&1 | tee build.log' + if grep -E 'gcc/jit/.*:.*warning:' build.log; then + echo "Warnings detected in libgccjit" + exit 1 + fi make install DESTDIR=$(pwd)/../install - name: Build Debian package diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc index 0dfc5a243f2d4..69b029c015540 100644 --- a/gcc/jit/jit-recording.cc +++ b/gcc/jit/jit-recording.cc @@ -7643,7 +7643,7 @@ recording::statement::write_to_dump (dump &d) for recording::memento_of_set_personality_function. */ void -recording::memento_of_set_personality_function::replay_into (replayer *r) +recording::memento_of_set_personality_function::replay_into (replayer *) { m_function->playback_function ()->set_personality_function (m_personality_function->playback_function ()); } diff --git a/gcc/jit/jit-recording.h b/gcc/jit/jit-recording.h index d782dc031baa4..fa45af0c60be0 100644 --- a/gcc/jit/jit-recording.h +++ b/gcc/jit/jit-recording.h @@ -658,7 +658,7 @@ class type : public memento virtual bool is_same_type_as (type *other) { - if ((is_int () && other->is_int () || is_float() && other->is_float()) + if (((is_int () && other->is_int ()) || (is_float() && other->is_float())) && get_size () == other->get_size () && is_signed () == other->is_signed ()) { @@ -2290,7 +2290,7 @@ class array_access : public lvalue void replay_into (replayer *r) final override; - void set_name (const char *new_name) final override { + void set_name (const char *) final override { m_ctxt->add_error (NULL, "cannot change the name of type `array_access`"); } @@ -2355,7 +2355,7 @@ class vector_access : public lvalue void visit_children (rvalue_visitor *v) final override; - void set_name (const char *new_name) final override { + void set_name (const char *) final override { m_ctxt->add_error (NULL, "cannot change the name of type `vector_access`"); } @@ -2388,7 +2388,7 @@ class access_field_of_lvalue : public lvalue void visit_children (rvalue_visitor *v) final override; - void set_name (const char *new_name) final override { + void set_name (const char *) final override { m_ctxt->add_error ( NULL, "cannot change the name of type `access_field_of_lvalue`"); } @@ -2451,7 +2451,7 @@ class dereference_field_rvalue : public lvalue void visit_children (rvalue_visitor *v) final override; - void set_name (const char *new_name) final override { + void set_name (const char *) final override { m_ctxt->add_error ( NULL, "cannot change the name of type `dereference_field_rvalue`"); } @@ -2482,7 +2482,7 @@ class dereference_rvalue : public lvalue void visit_children (rvalue_visitor *v) final override; - void set_name (const char *new_name) final override { + void set_name (const char *) final override { m_ctxt->add_error ( NULL, "cannot change the name of type `dereference_rvalue`"); } diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc index 988f89016c985..d6604a717b0f2 100644 --- a/gcc/jit/libgccjit.cc +++ b/gcc/jit/libgccjit.cc @@ -805,7 +805,6 @@ gcc_jit_context_new_array_type (gcc_jit_context *ctxt, JIT_LOG_FUNC (ctxt->get_logger ()); /* LOC can be NULL. */ RETURN_NULL_IF_FAIL (element_type, ctxt, loc, "NULL type"); - RETURN_NULL_IF_FAIL (num_elements >= 0, ctxt, NULL, "negative size"); RETURN_NULL_IF_FAIL (!element_type->is_void (), ctxt, loc, "void type for elements"); @@ -3058,7 +3057,7 @@ gcc_jit_block_add_try_catch (gcc_jit_block *block, RETURN_IF_FAIL (try_block, ctxt, loc, "NULL rvalue"); RETURN_IF_FAIL (catch_block, ctxt, loc, "NULL rvalue"); - gcc::jit::recording::statement *stmt = block->add_try_catch (loc, try_block, catch_block); + /*gcc::jit::recording::statement *stmt =*/ block->add_try_catch (loc, try_block, catch_block); // TODO: remove this or use it. /* "stmt" should be good enough to be usable in error-messages, @@ -3087,7 +3086,7 @@ gcc_jit_block_add_try_finally (gcc_jit_block *block, RETURN_IF_FAIL (try_block, ctxt, loc, "NULL rvalue"); RETURN_IF_FAIL (finally_block, ctxt, loc, "NULL rvalue"); - gcc::jit::recording::statement *stmt = block->add_try_catch (loc, try_block, finally_block, true); + /*gcc::jit::recording::statement *stmt =*/ block->add_try_catch (loc, try_block, finally_block, true); // TODO: remove this or use it. /* "stmt" should be good enough to be usable in error-messages,