-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
In different cases where enums are used, unused variables are generated in C.
Here is one example I could isolate.
enum E {
A = 1,
B = 2,
}
fn fun_a(_x: &[u8]) {}
fn fun_b(_x: &[u8]) {}
fn use_enum(e: E, x: &[u8]) {
match e {
E::A => fun_a(x),
E::B => fun_b(x),
}
}This generates the following C code.
Note that the function calls are dropped because they don't do anything. When they do something, they are called. But the uu____0 sticks around.
void eurydice_tests_use_enum(eurydice_tests_E e, Eurydice_slice x)
{
void *uu____0 = (void *)0U;
if (!(e == eurydice_tests_E_A))
{
return;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels