fix build error when -Werror=declaration-after-statement is enabled