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 clean up warning gnu++11 #71

Merged
merged 24 commits into from
Feb 12, 2024

Conversation

Thomasb81
Copy link
Contributor

Clean-up some compilation warning report by g++ 13.2.0

…c::Rectangle& vpsc::Rectangle::operator=(const vpsc::Rectangle&)' is deprecated [-Wdeprecated-copy]
…er expressions of different signedness: 'int' and 'std::vector<vpsc::Variable*>::size_type' {aka 'long unsigned int'} [-Wsign-compare]

cc_nonoverlapconstraints.cpp|204 col 40| warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<vpsc::Variable*>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
cc_nonoverlapconstraints.cpp|221 col 40| warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<vpsc::Variable*>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
cc_nonoverlapconstraints.cpp|223 col 40| warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<vpsc::Variable*>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
… 2 and 10 bytes into a region of size 9 [-Wformat-overflow=]
…nction [-Wreturn-type]

constraints.cpp|116 col 1| warning: control reaches end of non-void function [-Wreturn-type]
… std::out_of_range' by value [-Wcatch-value=]

constraints.cpp|327 col 53| warning: catching polymorphic type 'class std::out_of_range' by value [-Wcatch-value=]
chains.cpp|432 col 23| warning: catching polymorphic type 'class std::runtime_error' by value [-Wcatch-value=]
chains.cpp|441 col 23| warning: catching polymorphic type 'class std::runtime_error' by value [-Wcatch-value=]
graphs.cpp|829 col 19| warning: catching polymorphic type 'class std::out_of_range' by value [-Wcatch-value=]
topology_graph.cpp|298 col 31| warning: catching polymorphic type 'class std::runtime_error' by value [-Wcatch-value=]
…on [-Wreturn-type]

io.cpp|137 col 41| warning: 'gt' may be used uninitialized [-Wmaybe-uninitialized]
io.cpp|137 col 41| warning: 'sd' may be used uninitialized [-Wmaybe-uninitialized]
io.cpp|137 col 41| warning: 'st' may be used uninitialized [-Wmaybe-uninitialized]
…n [-Wreturn-type]

ortho.cpp|253 col 1| warning: control reaches end of non-void function [-Wreturn-type]
ortho.cpp|262 col 1| warning: control reaches end of non-void function [-Wreturn-type]
… in '>= 0' is always true [-Wtype-limits]

routing.cpp|150 col 27| warning: comparison of unsigned expression in '>= 0' is always true [-Wtype-limits]
Copy link
Collaborator

@skieffer skieffer left a comment

Choose a reason for hiding this comment

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

Thanks for this! It looks mostly good, but I do have some nitpicks.

Thanks also for naming the warnings that were being silenced in the commit messages, which made it much easier to review.

cola/libdialect/constraints.cpp Outdated Show resolved Hide resolved
cola/libdialect/constraints.cpp Outdated Show resolved Hide resolved
cola/libdialect/io.cpp Outdated Show resolved Hide resolved
cola/libdialect/quadaction.cpp Outdated Show resolved Hide resolved
cola/libdialect/routing.cpp Outdated Show resolved Hide resolved
cola/libdialect/util.h Outdated Show resolved Hide resolved
@Thomasb81
Copy link
Contributor Author

Thomasb81 commented Feb 11, 2024

There are remaining warning linked to deprecated construction :

typedef std::binder1st<

In some project fork:

        typedef std::binder1st<
            std::mem_fun1_t<void, Segment, StraightConstraint*> 
            > TransferStraightConstraint;

has been replaced by

#include <functional>
...
typedef std::function<void(StraightConstraint*)> TransferStraightConstraint;

But that's not enough to clean all related warnings.

Those warning also appear when we try to compile the swig python binding.

Copy link
Collaborator

@skieffer skieffer left a comment

Choose a reason for hiding this comment

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

Thanks for those changes. A couple more, but otherwise looks good.

cola/libdialect/graphs.cpp Outdated Show resolved Hide resolved
cola/libdialect/ortho.cpp Outdated Show resolved Hide resolved
cola/libdialect/ortho.cpp Outdated Show resolved Hide resolved
cola/libdialect/ortho.cpp Outdated Show resolved Hide resolved
cola/libdialect/routing.cpp Outdated Show resolved Hide resolved
@skieffer
Copy link
Collaborator

There are remaining warning linked to deprecated construction...

This sounds a fair bit more involved. How about opening a separate issue for it, and then we can get this one merged.

@skieffer skieffer merged commit 1b6afc5 into mjwybrow:master Feb 12, 2024
1 check passed
@skieffer
Copy link
Collaborator

Thanks again!

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.

2 participants