You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Discussed in #1018
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
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?
The text was updated successfully, but these errors were encountered: