Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget and WidgetMosaic fail to complie in a fresly installed VSCode (2021.01), [-Werror=reorder] #16

Open
Girgitt opened this issue Jan 18, 2021 · 1 comment

Comments

@Girgitt
Copy link

Girgitt commented Jan 18, 2021

There is an issue with the order in which private fields are declared in cpp files. It's a trivial fix and will issue a PR soon. This issue is just to reference the branch name for PR and leave a trace in case someone hits the same error. Adding -Werror=reorder build flag workaround does not work for this issue.


Library Manager: M5Stack @ 0.1.9 has been installed!
Library Manager: Installing NTPClient
Library Manager: Warning! More than one package has been found by NTPClient requirements:
 - arduino-libraries/NTPClient @ 3.1.0
 - limiteddata/NTPClient @ 3.1.0
 - mbed-dietergraef/NTPClient @ 0.0.0-alpha+sha.584a18640e84
 - mbed-robot-arm-demo-team/NTPClient @ 0.0.0+sha.9a7b8df5fad7
 - mbed-kkempeneers/NTPClient @ 0.0.0+sha.537dcd4ff837
 - mbed-ibiltari/NTPClient @ 0.0.0+sha.f31bb718d362
 - mbed-sparkfun/NTPClient @ 0.0.0+sha.881559865a93
 - mbed-vpcola/NTPClient @ 0.0.0+sha.0b96fbd7cfca
 - mbed-kubegmbh/NTPClient @ 0.0.0+sha.c2440e1c92cc
 - mbed-lmussier/NTPClient @ 0.0.0+sha.175284afeb38
Library Manager: Please specify detailed REQUIREMENTS using package owner and version (showed above) to avoid name conflicts
Library Manager: NTPClient @ 3.1.0 has been installed!
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <M5Stack> 0.1.9
|   |-- <FS> 1.0
|   |-- <SPIFFS> 1.0
|   |   |-- <FS> 1.0
|   |-- <SPI> 1.0
|   |-- <Wire> 1.0.1
|   |-- <SD(esp32)> 1.0.5
|   |   |-- <FS> 1.0
|   |   |-- <SPI> 1.0
|-- <NTPClient> 3.1.0
|-- <cfGUI> 0.3.0
|   |-- <M5Stack> 0.1.9
|   |   |-- <FS> 1.0
|   |   |-- <SPIFFS> 1.0
|   |   |   |-- <FS> 1.0
|   |   |-- <SPI> 1.0
|   |   |-- <Wire> 1.0.1
|   |   |-- <SD(esp32)> 1.0.5
|   |   |   |-- <FS> 1.0
|   |   |   |-- <SPI> 1.0
|-- <WiFi> 1.0


// a usual compilation output with couple of warnings removed   


Compiling .pio\build\m5stack-core-esp32\lib66b\cfGUI\ressources\wifi3.c.o
lib\cfGUI\src\Button.cpp: In member function 'virtual void Codingfield::UI::Button::Draw()':
lib\cfGUI\src\Button.cpp:98:50: warning: 'yTitle' may be used uninitialized in this function [-Wmaybe-uninitialized]
       M5.Lcd.drawString(title.c_str(), x, yTitle);
                                                  ^
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\ETH.cpp.o
Archiving .pio\build\m5stack-core-esp32\libbdf\libM5Stack.a
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\WiFi.cpp.o
In file included from lib\cfGUI\src\Widget.cpp:1:0:
lib\cfGUI\src\Widget.h: In constructor 'Codingfield::UI::Widget::Widget(Codingfield::UI::Widget*, Codingfield::UI::Point, Codingfield::UI::Size)':
lib\cfGUI\src\Widget.h:81:24: error: 'Codingfield::UI::Widget::parent' will be initialized after [-Werror=reorder]
       Widget* parent = nullptr;
                        ^
lib\cfGUI\src\Widget.h:79:13: error:   'Codingfield::UI::Point Codingfield::UI::Widget::position' [-Werror=reorder]
       Point position;
             ^
lib\cfGUI\src\Widget.cpp:9:1: error:   when initialized here [-Werror=reorder]
 Widget::Widget(Widget* parent, Point position, Size size) :  parent{parent}, position{position}, size {size} {
 ^
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\WiFiAP.cpp.o
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\WiFiClient.cpp.o
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\WiFiGeneric.cpp.o
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\WiFiMulti.cpp.o
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\WiFiSTA.cpp.o
cc1plus.exe: some warnings being treated as errors
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\WiFiScan.cpp.o
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\WiFiServer.cpp.o
Compiling .pio\build\m5stack-core-esp32\lib5bc\WiFi\WiFiUdp.cpp.o
*** [.pio\build\m5stack-core-esp32\lib66b\cfGUI\Widget.cpp.o] Error 1
In file included from lib\cfGUI\src\WidgetMosaic.cpp:1:0:
lib\cfGUI\src\WidgetMosaic.h: In constructor 'Codingfield::UI::WidgetMosaic::WidgetMosaic(Codingfield::UI::Widget*, Codingfield::UI::Point, Codingfield::UI::Size, int32_t, int32_t)':
lib\cfGUI\src\WidgetMosaic.h:25:15: error: 'Codingfield::UI::WidgetMosaic::nbColumns' will be initialized after [-Werror=reorder]
       int32_t nbColumns;
               ^
lib\cfGUI\src\WidgetMosaic.h:24:15: error:   'int32_t Codingfield::UI::WidgetMosaic::nbRows' [-Werror=reorder]
       int32_t nbRows;
               ^
lib\cfGUI\src\WidgetMosaic.cpp:4:1: error:   when initialized here [-Werror=reorder]
 WidgetMosaic::WidgetMosaic(Widget* parent, Point position, Size size, int32_t nbColumns, int32_t nbRows) : Widget(parent, position,
size),
 ^
cc1plus.exe: some warnings being treated as errors
*** [.pio\build\m5stack-core-esp32\lib66b\cfGUI\WidgetMosaic.cpp.o] Error 1
==================================================== [FAILED] Took 30.94 seconds ====================================================
@Girgitt
Copy link
Author

Girgitt commented Jan 18, 2021

fixed in PR #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant