Skip to content

Compiling Code Throws Warnings #104

@chadman98126

Description

@chadman98126

Colin/Jack:

When compiling the GEVCU code, the latest version of the Arduino IDE (1.8.11) throws the following errors when writing text strings, logging, etc. - several dozen actually. (see below the fold)

obviously these are warnings and the code will still compile, but pretty cumbersome having to debug around these. appears to be a syntax issue between C/C++. one approach might be to use
const char* vs. char* in each of the declarations -- the issue is primarily setting commonName and when sending log messages -- there may be others, but that's as far as I've gotten through all the warnings.

your thoughts on whether this is a really BAD idea or other options you might suggest - as you've been closest to the code throughout.

note: I'm loathe to suppress the warnings in the IDE, etc. for obvious reasons, but if that's the only practical option...


sketch/CanBrake.cpp: In constructor 'CanBrake::CanBrake()':
sketch/CanBrake.cpp:40:13: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
commonName = "CANBus brake";
^
sketch/CanBrake.cpp: In member function 'virtual void CanBrake::setup()':
sketch/CanBrake.cpp:46:71: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
Logger::info("add device: CanBrake (id: %X, %X)", CANBRAKEPEDAL, this);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions