pine64 / pine64_updater

Application for updating PINE64 devices, such as Pinecil
Other
174 stars 11 forks source link

Reorder member definitions to avoid compiler warning #15

Closed tormodvolden closed 3 years ago

tormodvolden commented 3 years ago

With this it compiles without any warnings here (gcc 9.3.0).

In file included from flashingthread.cpp:1: flashingthread.h: In constructor ‘FlashingThread::FlashingThread(QObject, bool, QString, bool)’: flashingthread.h:18:13: warning: ‘FlashingThread::firmwarePath’ will be initialized after [-Wreorder] 18 | QString firmwarePath; | ^~~~ flashingthread.h:17:10: warning: ‘bool FlashingThread::massErase’ [-Wreorder] 17 | bool massErase; | ^~~~~ flashingthread.h:10:5: warning: when initialized here [-Wreorder] 10 | FlashingThread(QObject parent = nullptr, bool driverMissing = false, QString firmwarePath = "", bool massErase = false) | ^~~~~~

tormodvolden commented 3 years ago

From Stroustrup via https://stackoverflow.com/a/14910427 : "The constructors are called in the order in which they are declared in the class rather than the order in which they appear in the initializer list."