Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4861

C/C++ • Re: Anyone know why I'm getting this warning about alarm_callback_t?

$
0
0
The code defines buttonPressed to return type alarm_callback_t. alarm_callback_t is a pointer to a function that takes the same two parameters and returns int64_t.

Clearly buttonPressed should not and does not return such a function pointer, but just the integer.

Perhaps you, or whoever wrote the wonky code, intended to declare that buttonPressed matched the typedef. Just define the function as it works, and the compiler will check that it matches the typedef when you pass its function pointer.

Statistics: Posted by jojopi — Sat Dec 07, 2024 11:41 pm



Viewing all articles
Browse latest Browse all 4861

Trending Articles