jasoncoon / esp32-fastled-webserver

Work in progress ESP32 port of https://github.com/jasoncoon/esp8266-fastled-webserver
GNU General Public License v3.0
197 stars 66 forks source link

Lots of warnings when building #20

Closed henrygab closed 4 years ago

henrygab commented 4 years ago

There are a number of warnings building this repository. For example:

Missing field initializers

In fields.h, while FieldList is an array, the array elements are each a POD struct of type Field, which has no non-default constructor. Therefore, according to the specification:

The effects of default initialization are: … otherwise, nothing is done: the objects with automatic storage duration (and their subobjects) are initialized to indeterminate values.

Comparisons always false due to limited range of data type

Simply put, the long result from string.toInt() was placed into an uint8_t, prior to clamping the value. This change stores the conversion result in a long to perform the clamping prior to storing the value in the uint8_t field.

"warning: extra tokens at end of #include directive"

No semi-colons after #include "file.h"

"error: multi-line comment [-Werror=comment]"

Don't allow the last character of a comment line to end in a backslash character.

"warning: 'typedef' was ignored in this declaration"

The typedef of Field is in the wrong spot.

marcmerlin commented 4 years ago

@jasoncoon are you able to include this patch? I'm seeing the same errors and for me such warnings count as errors.

jasoncoon commented 4 years ago

Sorry for the massive delay, thank you for the PR!