Fix stringification of libx52_led_state

A missing comma at the end of the STRINGIFY line was causing builds with
clang to have segfaults with the default configuration. It turned out
that due to the missing comma, the N_("Unknown LED state %d") and
N_("off") parameters were getting merged into a single parameter by
clang, but interestingly, not by GCC.

As a result, when building with clang, the array is "on", "red",
"amber", "green" - note the missing "off" at the beginning of the array.
This causes clang generated builds to segfault when attemping to log a
trace message when configuring LED A (which defaults to green, and the
index of LIBX52_LED_STATE_GREEN exceeds the array bounds).
reverse-scroll
nirenjan 2021-08-25 14:09:28 -07:00
parent ff10525028
commit 5be91b6e50
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ STRINGIFY(date_format, LIBX52_DATE_FORMAT_YYMMDD, N_("Unknown date format %d"),
N_("YY-MM-DD"),
)
STRINGIFY(led_state, LIBX52_LED_STATE_GREEN, N_("Unknown LED state %d")
STRINGIFY(led_state, LIBX52_LED_STATE_GREEN, N_("Unknown LED state %d"),
N_("off"),
N_("on"),
N_("red"),