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

Enable clang warnings used by LLVM #774

Merged
merged 6 commits into from
Oct 3, 2019
Merged

Enable clang warnings used by LLVM #774

merged 6 commits into from
Oct 3, 2019

Conversation

klausler
Copy link
Collaborator

@klausler klausler commented Oct 2, 2019

Enable -Wstring-conversion and -Wcovered-switch-default warnings when building with clang. Patch sources to dodge the warnings.

@klausler klausler requested review from jeanPerier and tskeith October 2, 2019 21:28
lib/common/idioms.h Outdated Show resolved Hide resolved
lib/common/idioms.h Outdated Show resolved Hide resolved
lib/parser/prescan.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@jeanPerier jeanPerier 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 dealing with these warnings. I could not test it yet because it does not compile in my sandbox (I think Tim already pointed out why).

// For switch statements whose cases have return statements for
// all possibilities. Clang emits warnings if the default: is
// present, gcc emits warnings if it is absent.
#if __clang__
Copy link
Member

Choose a reason for hiding this comment

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

Please update the style guide.

@@ -585,9 +585,6 @@ void OmpStructureChecker::Enter(
OmpClauseSet allowed{OmpClause::DEPEND};
SetContextAllowed(allowed);
} break;
default:
// TODO others
break;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This switch statement should also have SWITCH_COVERS_ALL_CASES as per the updated style guide

Copy link
Contributor

Choose a reason for hiding this comment

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

@klausler looks like @DavidTruby's comment fell through the cracks. @DavidTruby - can you submit a separate PR for it?

@sscalpone sscalpone merged commit c098156 into master Oct 3, 2019
@klausler klausler deleted the pmk-more-warnings branch October 4, 2019 16:21
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 9, 2020
Original-commit: flang-compiler/f18@c6b3420
Reviewed-on: flang-compiler/f18#774
Tree-same-pre-rewrite: false
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 9, 2020
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 9, 2020
Original-commit: flang-compiler/f18@b2a0503
Reviewed-on: flang-compiler/f18#774
Tree-same-pre-rewrite: false
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 9, 2020
Original-commit: flang-compiler/f18@48b81a2
Reviewed-on: flang-compiler/f18#774
Tree-same-pre-rewrite: false
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 9, 2020
Original-commit: flang-compiler/f18@7e11f81
Reviewed-on: flang-compiler/f18#774
Tree-same-pre-rewrite: false
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 9, 2020
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 9, 2020
…/pmk-more-warnings

Enable clang warnings used by LLVM

Original-commit: flang-compiler/f18@c098156
Reviewed-on: flang-compiler/f18#774
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
Original-commit: flang-compiler/f18@c6b3420
Reviewed-on: flang-compiler/f18#774
Tree-same-pre-rewrite: false
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
Original-commit: flang-compiler/f18@b2a0503
Reviewed-on: flang-compiler/f18#774
Tree-same-pre-rewrite: false
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
Original-commit: flang-compiler/f18@48b81a2
Reviewed-on: flang-compiler/f18#774
Tree-same-pre-rewrite: false
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
Original-commit: flang-compiler/f18@7e11f81
Reviewed-on: flang-compiler/f18#774
Tree-same-pre-rewrite: false
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
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.

6 participants