Skip to content

bug: two unused variable warnings in codegen.c #1597

@SchoolyB

Description

@SchoolyB

Description

make build produces two -Wunused-variable warnings in ezc/src/codegen/codegen.c:

src/codegen/codegen.c:6291:9: warning: unused variable 'if_depth' [-Wunused-variable]
 6291 |     int if_depth = cg->loop_scope_depth;
      |         ^~~~~~~~
src/codegen/codegen.c:7374:25: warning: unused variable 'ct' [-Wunused-variable]
 7374 |             const char *ct = ez_type_to_c_cg(cg, f->type_name);
      |                         ^~

Fix

Investigate whether these variables were intended to be used. If they're leftovers from incomplete work, remove the declarations entirely. If they were meant to be used downstream, complete the usage.

  • Line 6291: int if_depth = cg->loop_scope_depth; — assigned but never read
  • Line 7374: const char *ct = ez_type_to_c_cg(cg, f->type_name); — assigned but never read

The build should compile with zero warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcodegenRelated to C code generationgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions