diff options
author | Michaël Zasso <targos@protonmail.com> | 2021-02-12 22:58:42 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-02-28 16:39:59 +0300 |
commit | 96bcd52d3edd8ec4621640243e6161e2ea0dd6d8 (patch) | |
tree | d734d03bca0da0542392998d7a91456dd3057f35 /src | |
parent | c75f5f372db052cd8a190645b169b640c845bec5 (diff) |
src: disable unfixable MSVC warnings
The following warnings are disabled:
- C4065 in node_revert.h: there are no security reversions on the master
branch.
- C4003 in base64-inl.h: a macro is used four times, only once without
parameters.
PR-URL: https://github.com/nodejs/node/pull/37334
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/base64-inl.h | 8 | ||||
-rw-r--r-- | src/node_revert.h | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/base64-inl.h b/src/base64-inl.h index 1046fd83b9d..1b6cdd93f00 100644 --- a/src/base64-inl.h +++ b/src/base64-inl.h @@ -23,6 +23,11 @@ inline uint32_t ReadUint32BE(const unsigned char* p) { static_cast<uint32_t>(p[3]); } +#ifdef _MSC_VER +#pragma warning(push) +// MSVC C4003: not enough actual parameters for macro 'identifier' +#pragma warning(disable : 4003) +#endif template <typename TypeName> bool base64_decode_group_slow(char* const dst, const size_t dstlen, @@ -50,6 +55,9 @@ bool base64_decode_group_slow(char* const dst, const size_t dstlen, return true; // Continue decoding. } +#ifdef _MSC_VER +#pragma warning(pop) +#endif template <typename TypeName> size_t base64_decode_fast(char* const dst, const size_t dstlen, diff --git a/src/node_revert.h b/src/node_revert.h index 0f0c32412ef..edf6ad772ee 100644 --- a/src/node_revert.h +++ b/src/node_revert.h @@ -28,6 +28,12 @@ namespace per_process { extern unsigned int reverted_cve; } +#ifdef _MSC_VER +#pragma warning(push) +// MSVC C4065: switch statement contains 'default' but no 'case' labels +#pragma warning(disable : 4065) +#endif + inline const char* RevertMessage(const reversion cve) { #define V(code, label, msg) case SECURITY_REVERT_##code: return label ": " msg; switch (cve) { @@ -38,6 +44,10 @@ inline const char* RevertMessage(const reversion cve) { #undef V } +#ifdef _MSC_VER +#pragma warning(pop) +#endif + inline void Revert(const reversion cve) { per_process::reverted_cve |= 1 << cve; printf("SECURITY WARNING: Reverting %s\n", RevertMessage(cve)); |