Skip to content

Commit b47abbc

Browse files
committed
Fix warnings
1 parent 586d798 commit b47abbc

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ jobs:
3838
mkdir build install
3939
cd build
4040
../gcc/configure --enable-host-shared --enable-languages=c,jit,lto --disable-bootstrap --disable-multilib --prefix=/usr
41-
make -j4
41+
bash -o pipefail -c 'make -j4 2>&1 | tee build.log'
42+
if grep -E 'gcc/jit/.*:.*warning:' build.log; then
43+
echo "Warnings detected in libgccjit"
44+
exit 1
45+
fi
4246
make install DESTDIR=$(pwd)/../install
4347
4448
- name: Build Debian package

gcc/jit/jit-recording.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7643,7 +7643,7 @@ recording::statement::write_to_dump (dump &d)
76437643
for recording::memento_of_set_personality_function. */
76447644

76457645
void
7646-
recording::memento_of_set_personality_function::replay_into (replayer *r)
7646+
recording::memento_of_set_personality_function::replay_into (replayer *)
76477647
{
76487648
m_function->playback_function ()->set_personality_function (m_personality_function->playback_function ());
76497649
}

gcc/jit/jit-recording.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ class type : public memento
658658

659659
virtual bool is_same_type_as (type *other)
660660
{
661-
if ((is_int () && other->is_int () || is_float() && other->is_float())
661+
if (((is_int () && other->is_int ()) || (is_float() && other->is_float()))
662662
&& get_size () == other->get_size ()
663663
&& is_signed () == other->is_signed ())
664664
{
@@ -2290,7 +2290,7 @@ class array_access : public lvalue
22902290

22912291
void replay_into (replayer *r) final override;
22922292

2293-
void set_name (const char *new_name) final override {
2293+
void set_name (const char *) final override {
22942294
m_ctxt->add_error (NULL, "cannot change the name of type `array_access`");
22952295
}
22962296

@@ -2355,7 +2355,7 @@ class vector_access : public lvalue
23552355

23562356
void visit_children (rvalue_visitor *v) final override;
23572357

2358-
void set_name (const char *new_name) final override {
2358+
void set_name (const char *) final override {
23592359
m_ctxt->add_error (NULL, "cannot change the name of type `vector_access`");
23602360
}
23612361

@@ -2388,7 +2388,7 @@ class access_field_of_lvalue : public lvalue
23882388

23892389
void visit_children (rvalue_visitor *v) final override;
23902390

2391-
void set_name (const char *new_name) final override {
2391+
void set_name (const char *) final override {
23922392
m_ctxt->add_error (
23932393
NULL, "cannot change the name of type `access_field_of_lvalue`");
23942394
}
@@ -2451,7 +2451,7 @@ class dereference_field_rvalue : public lvalue
24512451

24522452
void visit_children (rvalue_visitor *v) final override;
24532453

2454-
void set_name (const char *new_name) final override {
2454+
void set_name (const char *) final override {
24552455
m_ctxt->add_error (
24562456
NULL, "cannot change the name of type `dereference_field_rvalue`");
24572457
}
@@ -2482,7 +2482,7 @@ class dereference_rvalue : public lvalue
24822482

24832483
void visit_children (rvalue_visitor *v) final override;
24842484

2485-
void set_name (const char *new_name) final override {
2485+
void set_name (const char *) final override {
24862486
m_ctxt->add_error (
24872487
NULL, "cannot change the name of type `dereference_rvalue`");
24882488
}

gcc/jit/libgccjit.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,6 @@ gcc_jit_context_new_array_type (gcc_jit_context *ctxt,
805805
JIT_LOG_FUNC (ctxt->get_logger ());
806806
/* LOC can be NULL. */
807807
RETURN_NULL_IF_FAIL (element_type, ctxt, loc, "NULL type");
808-
RETURN_NULL_IF_FAIL (num_elements >= 0, ctxt, NULL, "negative size");
809808
RETURN_NULL_IF_FAIL (!element_type->is_void (), ctxt, loc,
810809
"void type for elements");
811810

@@ -3058,7 +3057,7 @@ gcc_jit_block_add_try_catch (gcc_jit_block *block,
30583057
RETURN_IF_FAIL (try_block, ctxt, loc, "NULL rvalue");
30593058
RETURN_IF_FAIL (catch_block, ctxt, loc, "NULL rvalue");
30603059

3061-
gcc::jit::recording::statement *stmt = block->add_try_catch (loc, try_block, catch_block);
3060+
/*gcc::jit::recording::statement *stmt =*/ block->add_try_catch (loc, try_block, catch_block);
30623061

30633062
// TODO: remove this or use it.
30643063
/* "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,
30873086
RETURN_IF_FAIL (try_block, ctxt, loc, "NULL rvalue");
30883087
RETURN_IF_FAIL (finally_block, ctxt, loc, "NULL rvalue");
30893088

3090-
gcc::jit::recording::statement *stmt = block->add_try_catch (loc, try_block, finally_block, true);
3089+
/*gcc::jit::recording::statement *stmt =*/ block->add_try_catch (loc, try_block, finally_block, true);
30913090

30923091
// TODO: remove this or use it.
30933092
/* "stmt" should be good enough to be usable in error-messages,

0 commit comments

Comments
 (0)