Print this page
new smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/validation/constexpr-pointer-arith.c
          +++ new/usr/src/tools/smatch/src/validation/constexpr-pointer-arith.c
↓ open down ↓ 9 lines elided ↑ open up ↑
  10   10  static int *i = &b[1] + 1;                              // OK
  11   11  static int *j = b + 1;                                  // OK
  12   12  static int *k = d + 1;                                  // KO
  13   13  static int *l = &*&b[1];                                // OK
  14   14  static int *m = &*(&a + 1);                             // OK
  15   15  static int *n = &*(&b[1] + 1);                          // OK
  16   16  static int *o = &*(b + 1);                              // OK
  17   17  static int *p = &*(d + 1);                              // KO
  18   18  
  19   19  /*
  20      - * check-name: pointer arithmetic constness verification.
       20 + * check-name: consrexprness pointer arithmetic
  21   21   * check-command: sparse -Wconstexpr-not-const $file
  22   22   *
  23   23   * check-error-start
  24   24  constexpr-pointer-arith.c:8:19: warning: non-constant initializer for static object
  25   25  constexpr-pointer-arith.c:12:19: warning: non-constant initializer for static object
  26   26  constexpr-pointer-arith.c:17:22: warning: non-constant initializer for static object
  27   27   * check-error-end
  28   28   */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX