boarchuz / HULP

ESP32 ULP Coprocessor Helper
MIT License
183 stars 19 forks source link

Warning when using HULP_LBLA() #34

Closed Gfy63 closed 4 months ago

Gfy63 commented 5 months ago

Hi @boarchuz , i get this warning when using HULP_LBLA().

.pio/libdeps/pico32/HULP/src/hulp_macros.h:36:54: warning: narrowing conversion of '({...})' from 'int' to 'uint32_t' {aka 'unsigned int'} inside { } [-Wnarrowing]
             ( CONFIG_HULP_LABEL_AUTO_BASE + __LINE__); \
                                                      ^

With this change, the warning is history:

define HULP_LBLA() ({ \
            TRY_STATIC_ASSERT(__LINE__ <= (UINT16_MAX - CONFIG_HULP_LABEL_AUTO_BASE), (Auto label overflow)); \
            ( (uint32_t) CONFIG_HULP_LABEL_AUTO_BASE + __LINE__); \
        })

Correct?

Thanks for HULP