Print this page
new smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/validation/constexpr-compound-literal.c
          +++ new/usr/src/tools/smatch/src/validation/constexpr-compound-literal.c
↓ open down ↓ 1 lines elided ↑ open up ↑
   2    2  static int *b = &(int){ *a };   // KO
   3    3  
   4    4  static void foo(void)
   5    5  {
   6    6          int *b = &(int){ 1 };           // OK
   7    7          int *c = &(int){ *a };          // OK
   8    8          static int *d = &(int){ 1 };    // KO
   9    9  }
  10   10  
  11   11  /*
  12      - * check-name: compound literal address constness verification
       12 + * check-name: constexpr compound literal address
  13   13   * check-command: sparse -Wconstexpr-not-const $file
  14   14   *
  15   15   * check-error-start
  16   16  constexpr-compound-literal.c:2:25: warning: non-constant initializer for static object
  17   17  constexpr-compound-literal.c:8:27: warning: non-constant initializer for static object
  18   18   * check-error-end
  19   19   */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX