RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

remove leading underscore in log module variable name

Open david-vankampen opened this issue 3 years ago • 1 comments

https://github.com/RIOT-OS/RIOT/blob/bafb7d53c5b387d79f391b26be947233887361d8/sys/log/log_color/log_module.h#L80

per ISO/IEC 9899, Section 7.1.3, image variables that begin with a single underscore and a lower case letter are reserved by the language for file scope use.

david-vankampen avatar Jul 19 '22 13:07 david-vankampen

_ansi_codes is only used within the scope of that file -> follows that guideline ( _names are reseved for that usecase)

RIOT$ rg _ansi_codes
sys/log/log_color/log_module.h
80:static const char * const _ansi_codes[] =
98:    printf("%s", _ansi_codes[level]);

but this may as well be put into the the scope of that one function using it

on the other hand it is internal only -- it should be but it is not somehow it made its way into core/lib/include/log.h

kfessel avatar Jul 27 '22 13:07 kfessel

This is fixed with #18425

kfessel avatar May 17 '23 15:05 kfessel