Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Warnings and Their Fixes #97

Open
lior8 opened this issue Nov 27, 2024 · 2 comments
Open

Compilation Warnings and Their Fixes #97

lior8 opened this issue Nov 27, 2024 · 2 comments

Comments

@lior8
Copy link
Contributor

lior8 commented Nov 27, 2024

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:

  1. 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?
  2. 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.
  3. #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]"
@lior8 lior8 changed the title Mismatched Types Compilation Errors Compilation Warnings and Their Fixes Nov 27, 2024
@nathansttt
Copy link
Owner

There are a few reasons for these sorts of errors. Using a static_cast would likely fix most of them correctly, but I'm a bit leery of mass replacement, given the possibility of unintended consequences.

@lior8
Copy link
Contributor Author

lior8 commented Nov 27, 2024

I'll mostly look into indexes and do small PRs so they can be verified before pulling in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants