Seeing as how it's often times a bad idea to cast from a larger to a smaller type (say int
-> short
), I would like to add compiler flags (GCC) that make it an error (or at least a warning) to cast from larger to smaller types.
Are there flags to do this?
Edit: Yes, I am referring to implicit conversions. Thank you to the people who answered this question.