Skip to content

src: fix warnings on SPrintF

Refs: https://github.com/nodejs/node/pull/32551#discussion_r399830524 https://github.com/nodejs/node/pull/32385#pullrequestreview-378668359

Previous error message on Windows:

C:\Users\jasne\Projects\node\src\node_http2.cc(2738,13): warning C4244: 'initializing': conversion from 'T' to 'int', possible loss of data [C:\Users\jasne\Projects\node\libnode.vcxproj]
          with
          [
              T=int64_t
          ]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(39,1): warning C4806: '&': unsafe operation: no value of type 'T' promoted to type 'int' can equal the given constant [C:\Users\jasne\Projects\node\libnode.vcxproj]
          with
          [
              T=bool
          ]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(60): message : see reference to function template instantiation 'std::string node::ToStringHelper::BaseConvert<3,bool,0>(T)' being compiled [C:\Users\jasne\Projects\node\lib
node.vcxproj]
          with
          [
              T=bool
          ]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(97): message : see reference to function template instantiation 'std::string node::ToBaseString<3,bool&>(T)' being compiled [C:\Users\jasne\Projects\node\libnode.vcxproj]
          with
          [
              T=bool &
          ]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(117): message : see reference to function template instantiation 'std::string node::SPrintFImpl<bool&,>(const char *,Arg)' being compiled [C:\Users\jasne\Projects\node\libno
de.vcxproj]
          with
          [
              Arg=bool &
          ]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(117): message : see reference to function template instantiation 'std::string node::SPrintFImpl<int&,bool&>(const char *,Arg,bool &)' being compiled [C:\Users\jasne\Projects
\node\libnode.vcxproj]
          with
          [
              Arg=int &
          ]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(123): message : see reference to function template instantiation 'std::string node::SPrintFImpl<int&,int&,bool&>(const char *,Arg,int &,bool &)' being compiled [C:\Users\jas
ne\Projects\node\libnode.vcxproj]
          with
          [
              Arg=int &
          ]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(128): message : see reference to function template instantiation 'std::string node::SPrintF<int&,int&,bool&>(const char *,int &,int &,bool &)' being compiled [C:\Users\jasne
\Projects\node\libnode.vcxproj]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(137): message : see reference to function template instantiation 'void node::FPrintF<int&,int&,bool&>(FILE *,const char *,int &,int &,bool &)' being compiled [C:\Users\jasne
\Projects\node\libnode.vcxproj]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(150): message : see reference to function template instantiation 'void node::Debug<int32_t&,int32_t&,bool&>(node::EnabledDebugList *,node::DebugCategory,const char *,int32_t
 &,int32_t &,bool &)' being compiled [C:\Users\jasne\Projects\node\libnode.vcxproj]
C:\Users\jasne\Projects\node\src\node_http2.cc(354): message : see reference to function template instantiation 'void node::Debug<int32_t&,int32_t&,bool&>(node::Environment *,node::DebugCategory,const char *,int32_t &,int32_
t &,bool &)' being compiled [C:\Users\jasne\Projects\node\libnode.vcxproj]
C:\Users\jasne\Projects\node\src\debug_utils-inl.h(42,1): warning C4804: '>>=': unsafe use of type 'bool' in operation [C:\Users\jasne\Projects\node\libnode.vcxproj]
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading