For me the code compile without that bad change.
Bulldog's original code compiled for me too. I was just wondering if my use of casting:
(void (*)())(&fan2->handleInterrupt)would function properly, not just compile without error.
There are some warnings...
The warnings depend on what processor I try to compile for. No warnings for Uno. Yes warning for Teensy. IDE 1.82.
Anyway, the warnings are just sprint() complaining. They're unrelated to Bulldog's technique for the interrupt attachment.