diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-07-25 16:05:27 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-07-25 16:05:27 -0700 |
commit | 2d96be0322d71ce62e2f68d038070b10a7c9201b (patch) | |
tree | 140084663640fd718cb3bb1d01e649a23a883e4d /gencode.h | |
parent | 1a796886890fb989e2071d63d9d0279a046ec62c (diff) |
Check for, and squelch, signed vs. unsigned comparison errors.
Use -Wsign-compare if the compiler supports it.
If we're comparing an unsigned value with a signed value, and we've
already determined that the signed value is >= 0, just cast it to an
unsigned type.
Use 0xffffffffU instead of -1 as the "unknown"/"unset"/etc. value for
unsigned variables and fields.
Assign the result of str2tok() to an int, not a u_int, as it can return
-1.
Declare some variables and fields unsigned if they don't need to be
signed. Make sure some arguments passed into "set" functions are
non-negative (and otherwise not invalid).
In the BPF optimizer, cast the "constant" fields of a struct block to an
unsigned type - the actual constant field of a BPF instruction is
unsigned.
Also, cast away one warning from MSVC.
Diffstat (limited to 'gencode.h')
0 files changed, 0 insertions, 0 deletions