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

Fix warnings raised by GCC -Wpedactic #915

Merged
merged 4 commits into from
Nov 10, 2021
Merged

Conversation

jlblancoc
Copy link
Member

Basically extra ; here and there.
In the way, I updated some "old" typedef's by C++11's using.

@jlblancoc jlblancoc added quick-review Quick and easy PR to review low-priority Nice to have but not essential labels Nov 3, 2021
@dellaert
Copy link
Member

dellaert commented Nov 3, 2021

Seems like CI fails?

@jlblancoc
Copy link
Member Author

Seems like CI fails?

Yes, didn't test the unit tests... Now it should pass, let's wait for CI.

@jlblancoc
Copy link
Member Author

It now works. I "fixed" the issue that, for one particular macro, their instances sometimes had an ending semicolon and others they have not (giving raise to warnings if using -Wpedantic).
I peek at the sources and "fixed" it by:

  • If the most macro instances already were with final semicolon, add it to all remaining cases;
  • If it was the opposite, removing all semicolons; and
  • fixing the definition of the macro such that no additional semicolon is generated, i.e. if instances of the macro already had the macro, we don't want a semicolon in the definition, or viceversa.

The only remaining issue is that there is not a 100% consistent convention over the entire codebase, since for some macros the most common case was having a semicolon and for others it was not having it... for example:

  • Needs a final semicolon: GTSAM_CONCEPT_POSE_TYPE, GTSAM_MAKE_VECTOR_DEFS, ...
  • Does NOT need it: GTSAM_CONCEPT_TESTABLE_TYPE, ...

@dellaert , let me know if that's ok (and the PR can be merged), or if you prefer having a uniform convention (all macros with or w/o ";") which one is your preference...

Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

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

We could merge this now, but I agree with your sentiment (between the lines) that we should be consistent. If you have appetite to do so, I guess I prefer the semicolon in the macro, rather than in the test files. It's (a tiny bit) cleaner. I can go either way, though.

@dellaert
Copy link
Member

dellaert commented Nov 8, 2021

Cool. Merge at will after CI

@jlblancoc
Copy link
Member Author

Cool. Merge at will after CI

I recently found, under project settings, an option to enable "automatic merging". Despite the name, it's just a "do the merge after CI passes". Pretty useful...
A new button shows up at PRs and, for your settings it will mean that merge will happen after review + CI passes, automatically.

@jlblancoc jlblancoc merged commit 744db32 into develop Nov 10, 2021
@jlblancoc jlblancoc deleted the fix/gcc-Wpedantic-warnings branch November 10, 2021 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low-priority Nice to have but not essential quick-review Quick and easy PR to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants