-
Notifications
You must be signed in to change notification settings - Fork 37.8k
build: avoid repetitions when enabling warnings in configure.ac #18857
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
Conversation
Concept ACK b26f8a0 |
Concept ACK b26f8a0 |
Concept ACK Very nice initiative: this repetition has annoyed me :) |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
@@ -333,31 +333,36 @@ if test x$use_sanitizers != x; then | |||
]],[[]])]) | |||
fi | |||
|
|||
dnl APPEND_FLAG_IF_AVAILABLE([APPEND_TO_THIS_VARIABLE], [-WallExtra]) | |||
AC_DEFUN([APPEND_FLAG_IF_AVAILABLE], [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also define SET_FLAG_IF_AVAILABLE
and use throughout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be a little bit less straight forward. While such code would definitely benefit from it:
AX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]])
and become:
SET_FLAG_IF_AVAILABLE([SSE42_CXXFLAGS], [-msse4.2])
there are other usages where the code calls AC_MSG_ERROR()
if the flag is not available or does not compile with an additional $CXXFLAG_WERROR
.
I will consider this as a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah didn't check if all follow the same pattern. Separate PR is fine.
Concept ~0. Saving same verbosity is nice, but the downsides are now having a macro that obscures what's happening, and is applied inconsistently throughout configure; less than half of our This approach would also not work with the change currently proposed in #18882 (we'd end up with duplicate |
b26f8a0
to
f14b215
Compare
f14b215
to
d49d213
Compare
d49d213
to
e5d3519
Compare
Rebased. |
e5d3519
to
c635ea8
Compare
Rebased. |
cecdf95
to
dea032a
Compare
Rebased. |
dea032a
to
e6e1a0c
Compare
Rebased. |
e6e1a0c
to
86a0367
Compare
Rebased. |
86a0367
to
7b72014
Compare
Rebased. |
Introduce a macro APPEND_FLAG_IF_AVAILABLE() and use that.
7b72014
to
2a72758
Compare
My take is still the same as my comment above. I'm not convinced introducing an inconsistently used macro, to essentially save some line length, is a huge win. In general I prefer that we are explicit/verbose when it comes to anything build system related. |
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
Closing this because it needs frequent rebasing and it is not moving anywhere. It has 4 "Concept ACK" and 1 "Concept ~0". The point of this PR is to save repetitions, not line length. The introduced macro is not used everywhere (to replace If there is interest in this, I would be happy to reopen and rebase it. |
I tend to agree with @fanquake:
|
Introduce a macro
APPEND_FLAG_IF_AVAILABLE()
and use that.