Skip to content

Compile error on Linux due to new File::write function #5846

Closed
@TD-er

Description

@TD-er

See also this discussion: b1da9ed#r32622483

@devyte asked to open an issue about this.

In pull request #5525 there has been a new function added to the File class:

// Arduino "class SD" methods for compatibility
size_t write(const char *str) { return write((const uint8_t*)str, strlen(str)); }

This function causes compiler issues on Linux.

In file included from /home/gijs/GitHub/letscontrolit/ESPEasy/src/ESPEasy.ino:86:0:
/home/gijs/GitHub/letscontrolit/ESPEasy/src/ESPEasyStorage.ino: In function 'String ClearInFile(char*, int, int)':
/home/gijs/GitHub/letscontrolit/ESPEasy/src/ESPEasyStorage.ino:679:30: error: call of overloaded 'write(unsigned int)' is ambiguous
SPIFFS_CHECK(f.write(0), fname);
^

In short, this new function makes it impossible to use the existing function write(uint8_t)

size_t write(uint8_t) override;
size_t write(const uint8_t *buf, size_t size) override;

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