As the answer said here, I turned on -Wbad-function-cast to find out if the gcc behavior was bad in my code, and it appeared in this example:
unsigned long n;
(here it is not so important that the crossover be int , it could be unsigned long , and the message would be the same).
This seems like a pretty ordinary and useful casting example. Why is this problematic? Otherwise, is there a reason for warning about this warning?
I usually like to set a lot of warnings, but I can't think about this use case. The code I'm working on is of great numerical value, and there are many times when things are passed from one type to another, as required to satisfy the various needs of the algorithms involved.
source share