Skip to contentSkip to conversation

Clang warning in kernel/rcu/tasks.h

DISCUSSION Nathan Chancellor 2 participants 2 messages Mar 10, 2020 RCU

lore
Share & tools
lore
#0 lore raw

Hi Paul,

It appears that the commits 37564025a3d7 ("rcu-tasks: Refactor RCU-tasks to allow variants to be added") and cbd703932774 ("rcu-tasks: Add an RCU-tasks rude variant") both add a forward declaration to rcu_tasks and the rcu_tasks_gp_func_t typedef, resulting in the following clang warning:

In file included from kernel/rcu/update.c:563:
kernel/rcu/tasks.h:24:16: warning: redefinition of typedef 'rcu_tasks_gp_func_t' is a C11 feature [-Wtypedef-redefinition]

typedef void (*rcu_tasks_gp_func_t)(struct rcu_tasks *rtp);
               ^
kernel/rcu/tasks.h:17:16: note: previous definition is here
typedef void (*rcu_tasks_gp_func_t)(struct rcu_tasks *rtp);
               ^

1 warning generated.

Maybe a rebase or merge gone wrong? Would you mind taking a look and fixing it up if possible?

Cheers,
Nathan

maintainer
#1 lore raw
Quoted 15 lines · Nathan Chancellor

Hi Paul,

It appears that the commits 37564025a3d7 ("rcu-tasks: Refactor RCU-tasks to allow variants to be added") and cbd703932774 ("rcu-tasks: Add an RCU-tasks rude variant") both add a forward declaration to rcu_tasks and the rcu_tasks_gp_func_t typedef, resulting in the following clang warning:

In file included from kernel/rcu/update.c:563:
kernel/rcu/tasks.h:24:16: warning: redefinition of typedef 'rcu_tasks_gp_func_t' is a C11 feature [-Wtypedef-redefinition]

typedef void (*rcu_tasks_gp_func_t)(struct rcu_tasks *rtp);
               ^
kernel/rcu/tasks.h:17:16: note: previous definition is here
typedef void (*rcu_tasks_gp_func_t)(struct rcu_tasks *rtp);
               ^
Quoted 4 lines

1 warning generated.

Maybe a rebase or merge gone wrong? Would you mind taking a look and fixing it up if possible?

Will do, good catch, thank you!

Thanx, Paul