There are multiple compilation warnings in the codebase and I want to try to tackle a few of them. Therefore I have a few questions:
- Mismatched Types Compilation Errors
There are quite a few compilation warnings that relate to mismatched return or comparison types.
For example "int i" instead of "size_t i", which indeed should be size_t i.
But there are places where it is less obvious, for example unsigned int to int and vice versa. I was thinking of trying to figure out what would be the true appropriate type for them, but I am afraid of it breaking in certain edge cases. Would simple casting be appropriate here or is the former approach preferable?
- Unused static functions
I saw that inlining them can fix it, or instead removing the warning for unusued fuctions in the flags for compilation. Is there a preferred approach? I think adding "inline" to them can solve the problem.
- #pragma mark
Is this being used for something? I am compiling with GCC 9.4.0 and I get the following warning: "ignoring #pragma mark [-Wunknown-pragmas]"
There are multiple compilation warnings in the codebase and I want to try to tackle a few of them. Therefore I have a few questions:
There are quite a few compilation warnings that relate to mismatched return or comparison types.
For example "int i" instead of "size_t i", which indeed should be size_t i.
But there are places where it is less obvious, for example unsigned int to int and vice versa. I was thinking of trying to figure out what would be the true appropriate type for them, but I am afraid of it breaking in certain edge cases. Would simple casting be appropriate here or is the former approach preferable?
I saw that inlining them can fix it, or instead removing the warning for unusued fuctions in the flags for compilation. Is there a preferred approach? I think adding "inline" to them can solve the problem.
Is this being used for something? I am compiling with GCC 9.4.0 and I get the following warning: "ignoring #pragma mark [-Wunknown-pragmas]"