Print this page
new smatch


  46 static void test_static(void)
  47 {
  48         /* storage is not inherited */
  49         static int o;
  50         int *p = &o;                        /* check-should-pass */
  51 }
  52 
  53 static void test_tls(void)
  54 {
  55         /* storage is not inherited */
  56         static __thread int o;
  57         int *p = &o;                        /* check-should-pass */
  58 }
  59 
  60 /*
  61  * check-name: ptr-inherit.c
  62  *
  63  * check-error-start
  64 ptr-inherit.c:12:19: warning: incorrect type in initializer (different modifiers)
  65 ptr-inherit.c:12:19:    expected int *p
  66 ptr-inherit.c:12:19:    got int const *<noident>
  67 ptr-inherit.c:18:19: warning: incorrect type in initializer (different modifiers)
  68 ptr-inherit.c:18:19:    expected int *p
  69 ptr-inherit.c:18:19:    got int volatile *<noident>
  70 ptr-inherit.c:24:19: warning: incorrect type in initializer (different modifiers)
  71 ptr-inherit.c:24:19:    expected int *p
  72 ptr-inherit.c:24:19:    got int [noderef] *<noident>
  73 ptr-inherit.c:30:19: warning: incorrect type in initializer (different base types)
  74 ptr-inherit.c:30:19:    expected int *p
  75 ptr-inherit.c:30:19:    got restricted int *<noident>
  76 ptr-inherit.c:36:19: warning: incorrect type in initializer (different address spaces)
  77 ptr-inherit.c:36:19:    expected int *p
  78 ptr-inherit.c:36:19:    got int <asn:1>*<noident>
  79  * check-error-end
  80  */


  46 static void test_static(void)
  47 {
  48         /* storage is not inherited */
  49         static int o;
  50         int *p = &o;                        /* check-should-pass */
  51 }
  52 
  53 static void test_tls(void)
  54 {
  55         /* storage is not inherited */
  56         static __thread int o;
  57         int *p = &o;                        /* check-should-pass */
  58 }
  59 
  60 /*
  61  * check-name: ptr-inherit.c
  62  *
  63  * check-error-start
  64 ptr-inherit.c:12:19: warning: incorrect type in initializer (different modifiers)
  65 ptr-inherit.c:12:19:    expected int *p
  66 ptr-inherit.c:12:19:    got int const *
  67 ptr-inherit.c:18:19: warning: incorrect type in initializer (different modifiers)
  68 ptr-inherit.c:18:19:    expected int *p
  69 ptr-inherit.c:18:19:    got int volatile *
  70 ptr-inherit.c:24:19: warning: incorrect type in initializer (different modifiers)
  71 ptr-inherit.c:24:19:    expected int *p
  72 ptr-inherit.c:24:19:    got int [noderef] *
  73 ptr-inherit.c:30:19: warning: incorrect type in initializer (different base types)
  74 ptr-inherit.c:30:19:    expected int *p
  75 ptr-inherit.c:30:19:    got restricted int *
  76 ptr-inherit.c:36:19: warning: incorrect type in initializer (different address spaces)
  77 ptr-inherit.c:36:19:    expected int *p
  78 ptr-inherit.c:36:19:    got int <asn:1> *
  79  * check-error-end
  80  */