Skip to content

Compiler warnings #30

@dkerr64

Description

@dkerr64

It would be nice if you could clean up these compiler warnings...

warning: comparison of integer expressions of different signedness: 'size_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]

.pio/libdeps/ratgdo_esp8266_hV25/Improv/src/improv.cpp: In function 'bool improv::parse_improv_serial_byte(size_t, uint8_t, const uint8_t*, std::function<bool(improv::ImprovCommand)>&&, std::function<void(improv::Error)>&&)':
.pio/libdeps/ratgdo_esp8266_hV25/Improv/src/improv.cpp:84:16: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
   84 |   if (position <= 8 + data_len)
      |       ~~~~~~~~~^~~~~~~~~~~~~~~
.pio/libdeps/ratgdo_esp8266_hV25/Improv/src/improv.cpp:87:16: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
   87 |   if (position == 8 + data_len + 1) {
      |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~
.pio/libdeps/ratgdo_esp8266_hV25/Improv/src/improv.cpp: In function 'std::vector<unsigned char> improv::build_rpc_response(improv::Command, const std::vector<std::__cxx11::basic_string<char> >&, bool)':
.pio/libdeps/ratgdo_esp8266_hV25/Improv/src/improv.cpp:112:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'unsigned int'} [-Wsign-compare]
  112 |   for (int i = 0; i < datum.size(); i++) {
      |                   ~~^~~~~~~~~~~~~~
Archiving .pio/build/ratgdo_esp8266_hV25/lib858/libEEPROM.a
.pio/libdeps/ratgdo_esp8266_hV25/Improv/src/improv.cpp: In function 'std::vector<unsigned char> improv::build_rpc_response(improv::Command, const std::vector<String>&, bool)':
.pio/libdeps/ratgdo_esp8266_hV25/Improv/src/improv.cpp:152:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<String>::size_type' {aka 'unsigned int'} [-Wsign-compare]
  152 |   for (int i = 0; i < datum.size(); i++) {
      |                   ~~^~~~~~~~~~~~~~

A simple cast to (int) should do it.
Thanks.

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