Some more C99 standard functions to add to the list:

pop2lex.c:261:26: Unrecognized identifier: strtoll
  Identifier used in code has not been declared. (Use -unrecog to inhibit
  warning)


m% cat -n foo.c
     1  #include <stdlib.h>
     2  
     3  void foo(
     4      char const *p,
     5      long               /*@out@*/ *L,
     6      unsigned long      /*@out@*/ *U,
     7      long long          /*@out@*/ *LL,
     8      unsigned long long /*@out@*/ *UU
     9  ) {
    10      *L  = strtol(  p, (char **)0, 10);
    11      *U  = strtoul( p, (char **)0, 10);
    12      *LL = strtoll( p, (char **)0, 10);
    13      *UU = strtoull(p, (char **)0, 10);
    14  }
    15  
    16  #include <inttypes.h>
    17  
    18  void bar(
    19      char const *p,
    20      intmax_t  /*@out@*/ *I,
    21      uintmax_t /*@out@*/ *U
    22  ) {
    23      *I  = strtoimax( p, (char **)0, 10);
    24      *U  = strtoumax(p, (char **)0, 10);
    25  }
    26  

This is all legal C99.

m% splint foo.c
Splint 3.1.2a --- Mar 22 2017

foo.c: (in function foo)
foo.c:12:11: Unrecognized identifier: strtoll
  Identifier used in code has not been declared. (Use -unrecog to inhibit
  warning)
foo.c:13:11: Unrecognized identifier: strtoull
foo.c: (in function bar)
foo.c:23:11: Unrecognized identifier: strtoimax
foo.c:24:11: Unrecognized identifier: strtoumax

Finished checking --- 4 code warnings

I personally don't care about strto{i,u}max(),
but I do use strto{,u}ll reasonably often.

_______________________________________________
splint-discuss mailing list
splint-discuss@mail.cs.virginia.edu
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss

Reply via email to