Print this page
new smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/validation/constexpr-init.c
          +++ new/usr/src/tools/smatch/src/validation/constexpr-init.c
↓ open down ↓ 31 lines elided ↑ open up ↑
  32   32          int a = 0;
  33   33          int b = a;              // OK
  34   34  }
  35   35  
  36   36  static void s(void) {
  37   37          int a = 1;
  38   38          static int b = a;       // KO
  39   39  }
  40   40  
  41   41  /*
  42      - * check-name: static storage object initializer constness verification.
       42 + * check-name: constexprness static storage object initializer
  43   43   * check-command: sparse -Wconstexpr-not-const $file
  44   44   *
  45   45   * check-error-start
  46   46  constexpr-init.c:16:21: warning: non-constant initializer for static object
  47   47  constexpr-init.c:17:25: warning: non-constant initializer for static object
  48   48  constexpr-init.c:18:29: warning: non-constant initializer for static object
  49   49  constexpr-init.c:19:32: warning: non-constant initializer for static object
  50   50  constexpr-init.c:21:26: warning: non-constant initializer for static object
  51   51  constexpr-init.c:22:40: warning: non-constant initializer for static object
  52   52  constexpr-init.c:23:49: warning: non-constant initializer for static object
  53   53  constexpr-init.c:24:52: warning: non-constant initializer for static object
  54   54  constexpr-init.c:26:19: warning: non-constant initializer for static object
  55   55  constexpr-init.c:27:22: warning: non-constant initializer for static object
  56   56  constexpr-init.c:28:25: warning: non-constant initializer for static object
  57   57  constexpr-init.c:29:34: warning: non-constant initializer for static object
  58   58  constexpr-init.c:38:24: warning: non-constant initializer for static object
  59   59   * check-error-end
  60   60   */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX