Skip to content

int flush() in aJsonStream overrides void flush() in Print #89

Description

@ryanneve

It looks like aJsonStream.flush() returns an int, but is trying to override Print.flush() which returns void.

I'm getting compile errors with arduino 1.8.3:

In file included from C:\...\Energy_JSON.h:3:0,
                 from C:\...\Energy_JSON.cpp:1:
D:\Development\Arduino\libraries\aJson/aJSON.h:92:6: error: conflicting return type specified for 'virtual int aJsonStream::flush()'
  int flush();
      ^
In file included from D:\Development\Arduino\libraries\aJson/aJSON.h:28:0,
                 from C:\...\Energy_JSON.h:3,
                 from C:\...\Energy_JSON.cpp:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:90:18: error:   overriding 'virtual void Print::flush()'
     virtual void flush() { /* Empty implementation for backward compatibility */ }

Changing aJsonStream.flush() so it doesn't return anything fixes the problem, but not sure if it might create other problems.

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