-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enable -Werror in CMake (CI only) #9037
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4822577
Enable -Werror in CMake (CI only)
alexreinking c7c4bf8
Fix unused variable warning for has_scalable_vector in Target.cpp
alexreinking e87a146
Suppress unsafe CRT function warnings in halide_image_io.h
alexreinking 82b8ea1
Fix loss of precision in double-to-float conversion
alexreinking feb2003
Suppress unsafe CRT function warnings in test_sharding.h
alexreinking a6afb47
Set _CRT_SECURE_NO_WARNINGS for Halide::Test sources
alexreinking b746b5b
Fix float literal suffix.
alexreinking c12e80a
MSVC: cast M_PI to float (C4305)
alexreinking eafcda7
Normalize line endings in templates and string literals
alexreinking File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Wauw this sucks. We couldn't just normalize those source files?
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.
I think that's brittle. People's editors might change things locally and ephemerally before git renormalizes them. When we upgrade to C++20, this can be consteval
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.
No chance for a pre-commit check?
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.
It wouldn't help during local development. The scenario I'm envisioning is that someone edits CodeGen_C.cpp on Windows when it's checked out by git as LF. Upon save, their editor changes it silently to CRLF. I would hope most editors are smart about this, but who knows? Maybe someone is doing something weird like running VSCode in a WSL container yet compiling on Windows. Now there's a mix of line endings in the generated sources that will be very hard to track down.
I thought of a few alternative approaches but this seemed like the lowest-friction option:
Halide::Endlor something that expands to\non Unix and\r\non Windows.-textflag to binary2cpp that normalizes newlines in the template files. Doesn't fix the problem with raw string literals, though.gitattributes(which I think is what you were suggesting?)---but that's brittle for the reasons I just described. I don't like that it's outside the code. For example, what happens if someone downloads a ZIP of our sources from GitHub? Maybe it works, but I don't want to have to think about it or rely on it.It is incredibly vexing that the standard did not define the bytes of a newline in a raw string literal.