Various minor fixes for compiler/linter (other then splint itself) warnings.
[splint-patched.git] / test / constannot.c
blobbc5502c7e3c51f6ae091011f0b00033f0a0988dc
1 /*@constant int MaxLength=20@*/
2 # define MaxLength 20
4 void foo (char *str) /*@requires maxSet(str) >= MaxLength@*/
6 str[20] = 'a';
9 void foo2 (char *str) /*@requires maxSet(str) >= (MaxLength - 1)@*/
11 str[20] = 'a'; /* error */
14 void foo3 ()
16 char buf[MaxLength];
18 buf[0] = '\0';
20 foo (buf); /* error: off by 1 */
21 foo2 (buf); /* okay */