Skip to content

llvm/clang warnings: implicit conversion #1821

@vszakats

Description

@vszakats

These 4 warnings occur while compiling some of the source files:

In file included from ./nghttp2/lib/nghttp2_frame.c:33:
./nghttp2/lib/nghttp2_net.h:74:14: warning: implicit conversion changes signedness: 'int' to 'uint32_t' (aka 'unsigned int') [-Wsign-conversion]
  res = *p++ << 24;
      ~ ~~~~~^~~~~
./nghttp2/lib/nghttp2_net.h:75:15: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
  res += *p++ << 16;
      ~~ ~~~~~^~~~~
./nghttp2/lib/nghttp2_net.h:76:15: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
  res += *p++ << 8;                                      
      ~~ ~~~~~^~~~                                       
./nghttp2/lib/nghttp2_net.h:84:14: warning: implicit conversion loses integer precision: 'int' to 'uint16_t' (aka 'unsigned short') [-Wimplicit-int-conversion]
  res = *p++ << 8;                                                        
      ~ ~~~~~^~~~                                                         
4 warnings generated.                                                     

Compiler: llvm/clang 15.0.0 cross-compiling for Windows x64.

This looks like the same issue as in ngtcp2: ngtcp2/ngtcp2#599

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions