philbowles / PangolinMQTT

PangolinMQTT - ArduinoIDE client library for ESP8266, ESP32 and STM32-NUCLEO
Other
71 stars 21 forks source link

Compiler warns/fails with "will be initialized after [-Werror=reorder]" warning #37

Open smuellener opened 3 years ago

smuellener commented 3 years ago

There are multiple cases where members in the initializer list of classes have the wrong order. (see https://stackoverflow.com/questions/1564937/gcc-warning-will-be-initialized-after)

E.g.

PangolinMQTT\src\Packet.h:37:34: error: 'Packet::_controlcode' will be initialized after [-Werror=reorder] PangolinMQTT\src\Packet.h:36:41: error: 'bool Packet::_hasId' [-Werror=reorder] PangolinMQTT\src\Packet.h:51:9: error: when initialized here [-Werror=reorder]

Or also in AardvarkTCP\src\mbx.h

It would be great if you could ensure that the order is correct. I could also create pull requests for this if preferred..

Thank you, very excited to try this library!