#601428 splint incorrectly warns

Package:
splint
Source:
splint
Description:
tool for statically checking C programs for bugs
Submitter:
Pippijn van Steenhoven
Date:
2010-10-26 00:57:04 UTC
Severity:
normal
#601428#5
Date:
2010-10-26 00:55:21 UTC
From:
To:
Hi,

the following code:

  #include <limits.h>

  int main (void) {
    return 1 << CHAR_BIT;
  }

incorrectly makes splint emit the following warning:

  Right operand of << may be negative (int): 1 << CHAR_BIT

the obvious fix would be to change the declaration of CHAR_BIT in
standard.h from signed int to unsigned int. I don't know the
implications, though. So far, that seems to work.