# [solved] gcc warning: ‘ret’ may be used uninitialized

## toralf

I'm wondering about this warning message of gcc-4.6.3 of the current 3.6.0-rc4 kernel :

```
kernel/trace/trace_events_filter.c: In function ‘ftrace_function_set_filter_cb’:

kernel/trace/trace_events_filter.c:2074:8: warning: ‘ret’ may be used uninitialized in this function [-Wuninitialized]

```

b/cause the affected code looks like :

```
  2061  static int ftrace_function_set_filter_cb(enum move_type move,

  2062                                           struct filter_pred *pred,

  2063                                           int *err, void *data)

  2064  {

  2065          /* Checking the node is valid for function trace. */

  2066          if ((move != MOVE_DOWN) ||

  2067              (pred->left != FILTER_PRED_INVALID)) {

  2068                  *err = ftrace_function_check_pred(pred, 0);

  2069          } else {

  2070                  *err = ftrace_function_check_pred(pred, 1);

  2071                  if (*err)

  2072                          return WALK_PRED_ABORT;

  2073  

  2074                  *err = __ftrace_function_set_filter(pred->op == OP_EQ,

  2075                                                      pred->regex.pattern,

  2076                                                      pred->regex.len,

  2077                                                      data);

  2078          }

  2079  

  2080          return (*err) ? WALK_PRED_ABORT : WALK_PRED_DEFAULT;

  2081  }

  2082  

```

Is the string 'ret' only an abbreviation of 'return code', eg. in this case *err ? 

BTW where is WALK_PRED_ABORT defined ?Last edited by toralf on Sun Sep 02, 2012 8:55 am; edited 1 time in total

----------

## Etal

Maybe it's some kind of a weird inlining issue? I think it's referring to the ret in __ftrace_function_set_filter(), which would be uninitialized if the for-loop does not run (re_cnt ≤ 0)

----------

## toralf

 *Etal wrote:*   

> Maybe it's some kind of a weird inlining issue?

 Right - overlooked that.

Thx.

----------

