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

clang fixes #409

Merged
merged 2 commits into from
Feb 14, 2023
Merged

clang fixes #409

merged 2 commits into from
Feb 14, 2023

Conversation

nunojsa
Copy link
Contributor

@nunojsa nunojsa commented Feb 9, 2023

Needed to compile with clang. Both of the "fixes" make sense.

It might make sense to have a CI job to also compile things with clang. Compiling with more than one compiler is always a good thing as it allow us to catch more things.

Instead of redefining the gtk structs, let's just forward declare.
Otherwise clang was throwing this warning (treated as error):

"error: redefinition of typedef 'GtkToggleToolButton' is a C11 feature
[-Werror,-Wtypedef-redefinition]"

Naturally we could just move to c11, but using the forward declaration
still looks better.

Signed-off-by: Nuno Sa <[email protected]>
Need to make sure all fall-through labels are annotated so that clang
does not complain. A macro was added so that it looks better than using
plain compiler __attributes__.

Note that the macros is pretty direct which means there is no check to
make sure the compiler has the proper attribute. Nowadays, it should not
be an issue but if someone complains, we can then handle it at that time.

Signed-off-by: Nuno Sa <[email protected]>
Copy link
Contributor

@dNechita dNechita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@dNechita
Copy link
Contributor

I also added an issue (#411) to don't forget about your suggestion. Thanks!

@dNechita dNechita merged commit 26adc4d into master Feb 14, 2023
@dNechita dNechita deleted the dev/clang branch February 14, 2023 12:38
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

Successfully merging this pull request may close these issues.

3 participants