Print this page
11972 resync smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/validation/constexpr-addr-of-static.c
          +++ new/usr/src/tools/smatch/src/validation/constexpr-addr-of-static.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18          int a = 1;
  19   19          static int *b = &a;     // KO
  20   20  }
  21   21  
  22   22  static void m(void) {
  23   23          static int a = 1;
  24   24          static int *b = &a;     // OK
  25   25  }
  26   26  
  27   27  /*
  28      - * check-name: address of static object constness verification.
       28 + * check-name: constexpr static object address
  29   29   * check-command: sparse -Wconstexpr-not-const $file
  30   30   *
  31   31   * check-error-start
  32   32  constexpr-addr-of-static.c:6:17: warning: non-constant initializer for static object
  33   33  constexpr-addr-of-static.c:14:19: warning: non-constant initializer for static object
  34   34  constexpr-addr-of-static.c:19:26: warning: non-constant initializer for static object
  35   35   * check-error-end
  36   36   */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX