Originally posted by **jrudess** June 1, 2024
I've been finding -Wsign-compare to be pretty useful, except when it relates to generate-for loops.
Now this isn't really Slang's problem because it's a silly SV limitation going back to verilog-95 that genvar's can't have their types defined and are always integer type.
e.g. this code gets a -Wsign-compare warning
```
parameter int unsigned NUM_PORTS = 3;
for (genvar i = 0; i < NUM_PORTS; i++) begin
end
```
If I try to convert my parameters to 'int' to avoid sign-compare warnings with the generate-loops, then I just get them with comparisons against real 'logic' variables which are also unsigned. My general preference is to fix sign-compare for the logic vars and not fix the warnings for genvar cases.
What do you think about a new option to suppress the sign-compare warning only when genvar types are involved? Or maybe to split out genvars so they are not part of -Wsign-compare but maybe -Wgenvar-sign-compare?
Discussed in https://github.com/MikePopoloski/slang/discussions/1018