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>
This commit is contained in:
Michaël Zasso committed 2021-02-28 14:39:59 +01:00
1 parent c75f5f372d
commit 96bcd52d3e
2 files changed
+18

No files matched your search

+8
View File
@@ -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,
+10
View File
@@ -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));