Skip to content

Commit

Permalink
Fix GCC declaration-after-statement error
Browse files Browse the repository at this point in the history
Since upgrading to Linux v5.18 in Nixpkgs, we've been seeing an
"ISO C90 forbids mixed declarations and code" error from GCC.

This patch fixes it by initializing regs as part of its declaration,
meaning hook will no longer be declared after a statement.

Signed-off-by: Alyssa Ross <[email protected]>
  • Loading branch information
alyssais authored and gnif committed Sep 29, 2022
1 parent e65b850 commit 4b466e9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ static void notrace fh_trace_thunk(unsigned long ip, unsigned long parent_ip, st
#else
static void notrace fh_trace_thunk(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *ops, struct ftrace_regs *fregs)
{
struct pt_regs *regs;
regs = ftrace_get_regs(fregs);
struct pt_regs *regs = ftrace_get_regs(fregs);
#endif
struct ftrace_hook *hook = to_ftrace_hook(ops);

Expand Down

0 comments on commit 4b466e9

Please sign in to comment.