lg2: compile time checking for reserved header names
Add compile time checking for reserved header names like 'MESSAGE' as these would override the meaning at a journald level.
This bug was identif
lg2: compile time checking for reserved header names
Add compile time checking for reserved header names like 'MESSAGE' as these would override the meaning at a journald level.
This bug was identified in the review of a phosphor-virtual-sensor commit.
Example compile failure:
../virtualSensor.cpp:198:33: in ‘constexpr’ expansion of ‘lg2::details::header_str("MESSAGE")’ ../subprojects/phosphor-logging/lib/include/phosphor-logging/lg2/header.hpp:45:25: error: call to non-‘constexpr’ function ‘static void lg2::details::header_str::report_error(const char*)’ 45 | report_error("Header name is reserved.");
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I3a5c21fe25d307bf9b7fd296a71246a76d66872a
show more ...
|