lovyan03 / LovyanGFX

SPI LCD graphics library for ESP32 (ESP-IDF/ArduinoESP32) / ESP8266 (ArduinoESP8266) / SAMD51(Seeed ArduinoSAMD51)
Other
1.16k stars 206 forks source link

compile warnings when using GCC 8.4 with C++17 enabled #142

Closed estshorter closed 3 years ago

estshorter commented 3 years ago

Following compilation warnings occur when using GCC8.4 with C++17 enabled. I'm not sure this library supports C++17, but I reported this for your reference.

Note: This will not occur if the C++17 flag is not specified.

.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual void lgfx::v1::Bus_I2C::release()':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:46:37: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
     lgfx::i2c::release(_cfg.i2c_port);
                                     ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:157:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::release(int)', declared here
     cpp::result<void, error_t> release(int i2c_port);
                                ^~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual void lgfx::v1::Bus_I2C::beginTransaction()':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:60:46: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       lgfx::i2c::endTransaction(_cfg.i2c_port);
                                              ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:160:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::endTransaction(int)', declared here
     cpp::result<void, error_t> endTransaction(int i2c_port);
                                ^~~~~~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:62:85: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
     lgfx::i2c::beginTransaction(_cfg.i2c_port, _cfg.i2c_addr, _cfg.freq_write, false);
                                                                                     ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:159:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::beginTransaction(int, int, uint32_t, bool)', declared here
     cpp::result<void, error_t> beginTransaction(int i2c_port, int i2c_addr, std::uint32_t freq, bool read = false);
                                ^~~~~~~~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual void lgfx::v1::Bus_I2C::beginRead()':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:75:76: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       lgfx::i2c::restart(_cfg.i2c_port, _cfg.i2c_addr, _cfg.freq_read, true);
                                                                            ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:158:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::restart(int, int, uint32_t, bool)', declared here
     cpp::result<void, error_t> restart(int i2c_port, int i2c_addr, std::uint32_t freq, bool read = false);
                                ^~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:79:85: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       lgfx::i2c::beginTransaction(_cfg.i2c_port, _cfg.i2c_addr, _cfg.freq_read, true);
                                                                                     ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:159:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::beginTransaction(int, int, uint32_t, bool)', declared here
     cpp::result<void, error_t> beginTransaction(int i2c_port, int i2c_addr, std::uint32_t freq, bool read = false);
                                ^~~~~~~~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual void lgfx::v1::Bus_I2C::endTransaction()':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:92:44: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
     lgfx::i2c::endTransaction(_cfg.i2c_port);
                                            ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:160:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::endTransaction(int)', declared here
Compiling .pio\build\m5paper\src\main.cpp.o
     cpp::result<void, error_t> endTransaction(int i2c_port);
                                ^~~~~~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~Generating partitions .pio\build\m5paper\partitions.bin
~~Compiling .pio\build\m5paper\lib192\SPI\SPI.cpp.o
~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'void lgfx::v1::Bus_I2C::dc_control(bool)':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:118:46: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       lgfx::i2c::endTransaction(_cfg.i2c_port);
                                              ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:160:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::endTransaction(int)', declared here
     cpp::result<void, error_t> endTransaction(int i2c_port);
                                ^~~~~~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:125:87: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       lgfx::i2c::beginTransaction(_cfg.i2c_port, _cfg.i2c_addr, _cfg.freq_write, false);
                                                                                       ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:159:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::beginTransaction(int, int, uint32_t, bool)', declared here
     cpp::result<void, error_t> beginTransaction(int i2c_port, int i2c_addr, std::uint32_t freq, bool read = false);
                                ^~~~~~~~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:138:46: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       lgfx::i2c::endTransaction(_cfg.i2c_port);
                                              ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:160:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::endTransaction(int)', declared here
     cpp::result<void, error_t> endTransaction(int i2c_port);
                                ^~~~~~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:139:87: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       lgfx::i2c::beginTransaction(_cfg.i2c_port, _cfg.i2c_addr, _cfg.freq_write, false);
                                                                                       ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:159:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::beginTransaction(int, int, uint32_t, bool)', declared here
     cpp::result<void, error_t> beginTransaction(int i2c_port, int i2c_addr, std::uint32_t freq, bool read = false);
                                ^~~~~~~~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:141:117: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
     lgfx::i2c::writeBytes(_cfg.i2c_port, (std::uint8_t*)(dc ? &_cfg.prefix_data : &_cfg.prefix_cmd), _cfg.prefix_len);
                                                                                                                     ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:161:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::writeBytes(int, const uint8_t*, std::size_t)', declared here
     cpp::result<void, error_t> writeBytes(int i2c_port, const std::uint8_t *data, std::size_t length);
                                ^~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual void lgfx::v1::Bus_I2C::writeData(uint32_t, uint_fast8_t)': 
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:154:81: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
     lgfx::i2c::writeBytes(_cfg.i2c_port, (std::uint8_t*)&data, (bit_length >> 3));
                                                                                 ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:161:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::writeBytes(int, const uint8_t*, std::size_t)', declared here
     cpp::result<void, error_t> writeBytes(int i2c_port, const std::uint8_t *data, std::size_t length);
                                ^~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual void lgfx::v1::Bus_I2C::writeDataRepeat(uint32_t, uint_fast8_t, uint32_t)':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:186:58: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       i2c::writeBytes(_cfg.i2c_port, buf, len * dst_bytes);
                                                          ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:161:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::writeBytes(int, const uint8_t*, std::size_t)', declared here
     cpp::result<void, error_t> writeBytes(int i2c_port, const std::uint8_t *data, std::size_t length);
                                ^~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual void lgfx::v1::Bus_I2C::writePixels(lgfx::v1::pixelcopy_t*, 
uint32_t)':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:201:58: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       i2c::writeBytes(_cfg.i2c_port, buf, len * dst_bytes);
                                                          ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:161:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::writeBytes(int, const uint8_t*, std::size_t)', declared here
     cpp::result<void, error_t> writeBytes(int i2c_port, const std::uint8_t *data, std::size_t length);
                                ^~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual void lgfx::v1::Bus_I2C::writeBytes(const uint8_t*, uint32_t, bool, bool)':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:208:48: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
     i2c::writeBytes(_cfg.i2c_port, data, length);
                                                ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:161:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::writeBytes(int, const uint8_t*, std::size_t)', declared here
     cpp::result<void, error_t> writeBytes(int i2c_port, const std::uint8_t *data, std::size_t length);
                                ^~~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual uint32_t lgfx::v1::Bus_I2C::readData(uint_fast8_t)':        
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:215:89: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
     i2c::readBytes(_cfg.i2c_port, reinterpret_cast<std::uint8_t*>(&res), bit_length >> 3);
                                                                                         ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:162:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::readBytes(int, uint8_t*, std::size_t)', declared here
     cpp::result<void, error_t> readBytes(int i2c_port, std::uint8_t *data, std::size_t length);
                                ^~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp: In member function 'virtual void lgfx::v1::Bus_I2C::readPixels(void*, lgfx::v1::pixelcopy_t*, uint32_t)':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:237:71: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       i2c::readBytes(_cfg.i2c_port, (std::uint8_t*)regbuf, len * bytes);
                                                                       ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
Compiling .pio\build\m5paper\lib7dc\Wire\Wire.cpp.o
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:162:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::readBytes(int, uint8_t*, std::size_t)', declared here
     cpp::result<void, error_t> readBytes(int i2c_port, std::uint8_t *data, std::size_t length);
                                ^~~~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
Archiving .pio\build\m5paper\libFrameworkArduinoVariant.a
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.hpp:21,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_I2C.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::init(int, 
int, int)':
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/common.cpp:505:23: warning: ignoring returned value of type 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>', declared with attribute nodiscard [-Wunused-result]
       release(i2c_port);
                       ^
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/common.cpp:22:
.pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:157:32: note: in call to 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::release(int)', declared here
     cpp::result<void, error_t> release(int i2c_port);
                                ^~~~~~~
In file included from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:22,
Compiling .pio\build\m5paper\FrameworkArduino\Esp.cpp.o
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/../common.hpp:29,
                 from .pio/libdeps/m5paper/LovyanGFX/src/lgfx/v1/platforms/esp32/common.cpp:22:
c:\users\estshorter\src\esp\.pio\libdeps\m5paper\lovyangfx\src\lgfx\utility\result.hpp:2659:26: note: 'cpp::bitwizeshift::result<void, lgfx::v1::error_t>' declared here
   class RESULT_NODISCARD result<void,E>
                          ^~~~~~~~~~~~~~

Code example

platformio.ini

[platformio]
packages_dir = .pio/packages

[env:m5paper]
platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
board = m5stack-fire
framework = arduino
platform_packages =
     framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
build_flags =
  -std=gnu++17
  -DBOARD_HAS_PSRAM
  -mfix-esp32-psram-cache-issue
build_unflags =
  -std=gnu++11
lib_deps =
  https://github.com/lovyan03/LovyanGFX

src/main.cpp

#define LGFX_AUTODETECT
#include <LovyanGFX.hpp>

void setup(void)
{
}

void loop(void)
{
}

Environment

Appendix

buildlog.txt

tobozo commented 3 years ago

hey @estshorter,

Thanks for your feedback.

Quick workaround: unless you prepend all offending function calls with (void)! you can suppress those warnings by adding an extra -Wno-unused-result flag:

build_flags = 
  -std=gnu++17
  -DBOARD_HAS_PSRAM
  -mfix-esp32-psram-cache-issue
  -Wno-unused-result
lovyan03 commented 3 years ago

@estshorter Thanks for the report ! I've adjusted the code in the develop branch to suppress the warning.

estshorter commented 3 years ago

Thanks for the quick fix!

But, the same warning still occurs at the following lines.

estshorter commented 3 years ago

Note: #define LGFX_USE_V1 produces tons of unused-result warnings. Adding the -Wno-unused-result flag may be a good idea as as @tobozo said. build_with_LGFX_USE_V1.txt

lovyan03 commented 3 years ago

@estshorter Sorry. Readjusted. I've tweaked the result library and fundamentally killed warnings.

estshorter commented 3 years ago

Thanks! I've confirmed that LovyanGFX can be compiled without warnings (even when #define LGFX_USE_V1)!