chakra-core / chakra-core/ChakraCore

Warning switches

Open
#6,435 1 comment 0 reactions 0 assignees View on GitHub
Codebase Quality Dev Experience help wanted Task
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

While working on #6430 I've noticed that there are no includes for `unicode/uchar.h`, which was puzzling at first, but then I realized that`-Wno-implicit-function-declaration` set up in CMake inhibits complaints about that.

Implicit function declarations are dangerous, because they can hide mismatches between definition and use (which actually happened when ICU failed to build in time for the link). It is a warning (rather than an error) due to backwards compatibility with older C standards.

But there are [even more](https://github.com/microsoft/ChakraCore/blob/9d644c51c5914deebf2d437f5fd8c58acbeda3fc/CMakeLists.txt#L308):

- [ ] `-Wno-ignored-attributes`
- [x] `-Wno-deprecated-declarations`
- [ ] `-Wno-parentheses-equality`
- [x] `-Wno-missing-braces`
- [ ] `-Wno-reorder`
- [ ] `-Wno-microsoft`
- [ ] `-Wno-unused-value`
- [ ] `-Wno-int-to-void-pointer-cast`
- [ ] `-Wno-invalid-offsetof`
- [ ] `-Wno-undefined-inline`
- [ ] `-Wno-inconsistent-missing-override`
- [ ] `-Wno-c++14-extensions`
- [ ] `-Wno-macro-redefined`
- [ ] `-Wno-pragmas`
- [ ] `-Wno-invalid-token-paste`
- [ ] `-Wno-format`
- [ ] `-Wno-invalid-noreturn`
- [ ] `-Wno-null-arithmetic`
- [ ] `-Wno-tautological-constant-out-of-range-compare`
- [ ] `-Wno-tautological-undefined-compare`
- [ ] `-Wno-address-of-temporary`
- [ ] `-Wno-null-conversion`
- [ ] `-Wno-return-type`
- [ ] `-Wno-switch`
- [x] `-Wno-implicit-function-declaration` (both C and C++)
- [ ] `-Wno-int-to-pointer-cast`
- [ ] `-Wno-tautological-constant-compare`
- [ ] `-Wno-enum-compare-switch`
- [ ] `-Wno-unknown-warning-option`

```
# notes..
# -Wno-address-of-temporary # vtinfo.h, VirtualTableInfo::RegisterVirtualTable
# -Wno-null-conversion # Check shmemory.cpp and cs.cpp here...
# -Wno-return-type # switch unreachable code
# -Wno-switch # switch values not handled
# -W-enum-compare-switch # throws warning on enum1 == enum2 where both
# enums represent same value but do not share the type. ie. we use both AsmJsType
# and AsmJsRetType interchangably and filter things out by `default:` case.
# -W-tautological-constant-compare throws warning for checks known at compile time.
# Some of those checks are optimized out during compile / lto time, and others
# are platform / compiler dependent.
# -Wno-unknown-warning-option ... well, some of the new switches are not
# recognized by older compilers and they fail. So, put this one and not fail

```
Does anybody remember what was motivation for adding those, aside from the ones that have a note below?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.