Skip to content

clang-tidy: use = default and default member init #40

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Jul 5, 2022

No description provided.

neheb added 2 commits July 5, 2022 16:31
Found with modernize-use-equals-default
Found with modernize-use-default-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with performance-trivially-destructible

Signed-off-by: Rosen Penev <rosenp@gmail.com>
@kjellahl
Copy link
Collaborator

kjellahl commented Jul 6, 2022

It was obvious that PR #36 would break ABI. In this PR, it's not obvious, but
I suspect that one or two of the changes can break ABI, replacing a non-inlined
method with an inlined one, thus removing a symbol from the library file.
I may take the time to investigate further some day. Unfortunately, even if I find
that all changes preserve ABI with the compilers I have easily available (gcc and clang),
ABI might break for someone using other compilers.

A general comment concerning your many PRs: clang-tidy is too nitpicking.
We don't have the ambition to make clang-tidy happy with all checks enabled.
This kind of micro-fixes aren't worth the trouble, especially not when there's
even the slightest risk of breaking ABI.
If you want to make contributions that make a difference to users of libxml++,
you would be very welcome. You could for instance fix bugs (there aren't any known
at the moment) or add useful functionality. It's possible that there are functions
in libxml2 that haven't been wrapped in C++ code. Other than making it possible to
build with Meson, I have spent very little time on libxml++ the last few years.
I intend to spend even less in the future.

@neheb
Copy link
Contributor Author

neheb commented Jul 6, 2022

Only the second commit would have an issue like that.

@kjellahl
Copy link
Collaborator

There is a good old rule saying If it ain't broke, don't fix it.
Your PRs do just that, they fix (or you could say update) working code.
In most cases such changes are not worth doing. There are cases where it's worth
doing. For instance override is fine. It means the compiler can check that a
virtual function is really overridden. = delete is clearer than private
methods not being defined. But generally, leave old code alone as long as it works
and no compiler complains. New code is another matter.

@kjellahl
Copy link
Collaborator

Sorry, but I don't want to merge this PR. I find most of the changes unnecessary
and uninteresting. If you want to, you can keep it open and hope that another
maintainer in the future has a different opinion.

PRs that fix bugs or add new useful functionality are always welcome.

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