pytorch
d68c314b - [warnings][caffe2] Fix asserts yielding -Wstring-conversion warnings (#72013)

Commit
2 years ago
[warnings][caffe2] Fix asserts yielding -Wstring-conversion warnings (#72013) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/72013 Find and replace `assert(!"` with `assert(false && "` Excludes headers and paths that contain "third-party" or "external" Clang raises a `-Wstring-conversion` warning when treating a string as a boolean. This is not uncommon for asserts though (e.g. `assert(!"should never happen")`). Clang does permit `expr && "string"` though in order to support these assertion use cases. Test Plan: ci pass Differential Revision: D33823092 fbshipit-source-id: 9a1af012215bdc91f8b4162ddb2df28d51539773 (cherry picked from commit 0286910350492eea61050bd9c7d21727b607858c)
Author
Nolan O'Brien
Committer
Parents
Loading