legatoproject / legato-af

Legato Application Framework
Mozilla Public License 2.0
153 stars 118 forks source link

Macros in le_log.h don't scope their if-statements. #54

Closed robertselberg closed 4 years ago

robertselberg commented 4 years ago

Take the LE_TRACE macro for example. You can't use it like this since the macro is implemented using an unscoped if-statement: if(blah) LE_TRACE(....) else LE_TRACE(...)

The macro is currently implemented like this: #define LE_TRACE(traceRef, string, ...) if(bla) { ... }

And should be changed to something like this: #define LE_TRACE(traceRef, string, ...) { if(bla) { ... } }

There are also other macros that aren't scoped in this file.

CoRfr commented 4 years ago

Thanks for reporting this issue @robertselberg , it should be addressed by https://github.com/legatoproject/legato-af/commit/fba6acd946e684c97a6bb27f70a0e34e528602d7