Commit 573e951
authored
Fix string to bool conversion warnings in asserts (#2746)
/SPIRV-LLVM-Translator/lib/SPIRV/SPIRVRegularizeLLVM.cpp:535:15: warning: implicit conversion turns string literal into bool: 'const char[39]' to 'bool' [-Wstring-conversion]
535 | assert(!"Cache controls must decorate a pointer");
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
93 | (static_cast <bool> (expr) \
| ^~~~
The original code is not wrong but `false &&` is only a few
characters more and does the same thing without warning.1 parent 38db490 commit 573e951
2 files changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
| 516 | + | |
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
| 522 | + | |
| 523 | + | |
523 | 524 | | |
524 | 525 | | |
525 | 526 | | |
| |||
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
535 | | - | |
| 536 | + | |
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5451 | 5451 | | |
5452 | 5452 | | |
5453 | 5453 | | |
5454 | | - | |
| 5454 | + | |
5455 | 5455 | | |
5456 | 5456 | | |
5457 | 5457 | | |
| |||
0 commit comments