Skip to content

Conversion of argument 1 would be ill-formed #7

@tonyxforce

Description

@tonyxforce

I am using the library that you forked but it doesn't allow issues so please excuse me if you already fixed this error.

I've been using this library out of nowhere but i recently added a bunch of log statements and it started giving me errors during compiling but VSC doesn't show where it came from

the errors are

.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h: In instantiation of 'void Logging::printLevel(int, bool, T, ...) [with T = int]':
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:318:5:   required from 'void Logging::verboseln(T, Args ...) [with T = int; Args = {}]'
src/ltr390.h:47:20:   required from here
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:360:3: error: no matching function for call to 'print(int&, va_list&)'
   print(msg, args);
   ^~~~~
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:323:7: note: candidate: 'void Logging::print(const char*, va_list)' <near match>
  void print(const char *format, va_list args);
       ^~~~~
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:323:7: note:   conversion of argument 1 would be ill-formed:
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:360:9: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   print(msg, args);
         ^~~
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:325:7: note: candidate: 'void Logging::print(const __FlashStringHelper*, va_list)' <near match>
  void print(const __FlashStringHelper *format, va_list args);
       ^~~~~
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:325:7: note:   conversion of argument 1 would be ill-formed:
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:360:9: error: invalid conversion from 'int' to 'const __FlashStringHelper*' [-fpermissive]
   print(msg, args);
         ^~~
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h: In instantiation of 'void Logging::printLevel(int, bool, T, ...) [with T = unsigned int]':
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:312:5:   required from 'void Logging::verbose(T, Args ...) [with T = unsigned int; Args = {}]'
src/ltr390.h:92:29:   required from here
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:360:3: error: no matching function for call to 'print(unsigned int&, va_list&)'
   print(msg, args);
   ^~~~~
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:323:7: note: candidate: 'void Logging::print(const char*, va_list)' <near match>
  void print(const char *format, va_list args);
       ^~~~~
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:323:7: note:   conversion of argument 1 would be ill-formed:
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:360:9: error: invalid conversion from 'unsigned int' to 'const char*' [-fpermissive]
   print(msg, args);
         ^~~
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:325:7: note: candidate: 'void Logging::print(const __FlashStringHelper*, va_list)' <near match>
  void print(const __FlashStringHelper *format, va_list args);
       ^~~~~
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:325:7: note:   conversion of argument 1 would be ill-formed:
.pio/libdeps/esp32/ArduinoLog/ArduinoLog.h:360:9: error: invalid conversion from 'unsigned int' to 'const __FlashStringHelper*' [-fpermissive]
   print(msg, args);

edit: formatting

edit2: I've tested it with your library but the error still occurs

edit3: I've did some debugging and turns out calling Log.verboseln(1); causes this error to happen, it can be fixed by using Log.verboseln("1"); or if the number is a variable, Log.verboseln(String(number).c_str());

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