kernel: Fix -Wformat-security

Change-Id: Ie07933315c055ba1e6896e0bf69b12bb6bec62f9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3343
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Murai Takashi 2020-10-15 06:07:48 +09:00 committed by Jérôme Duval
parent edb4846779
commit d56df58f3f
2 changed files with 6 additions and 3 deletions

View File

@ -180,7 +180,7 @@ get_variable(const char* variableName, bool create)
static int
cmd_unset_variable(int argc, char **argv)
{
static const char* usage = "usage: unset <variable>\n"
static const char* const usage = "usage: unset <variable>\n"
"Unsets the given variable, if it exists.\n";
if (argc != 2 || strcmp(argv[1], "--help") == 0) {
kprintf(usage);
@ -199,7 +199,7 @@ cmd_unset_variable(int argc, char **argv)
static int
cmd_unset_all_variables(int argc, char **argv)
{
static const char* usage = "usage: %s\n"
static const char* const usage = "usage: %s\n"
"Unsets all variables.\n";
if (argc == 2 && strcmp(argv[1], "--help") == 0) {
kprintf(usage, argv[0]);
@ -215,7 +215,7 @@ cmd_unset_all_variables(int argc, char **argv)
static int
cmd_variables(int argc, char **argv)
{
static const char* usage = "usage: vars\n"
static const char* const usage = "usage: vars\n"
"Unsets the given variable, if it exists.\n";
if (argc != 1) {
kprintf(usage);

View File

@ -392,7 +392,10 @@ extern "C"
void
debugger(const char *message)
{
// this is a wrapper, disable format diagnostics.
#pragma GCC diagnostic ignored "-Wformat-security"
kernel_debugger(message);
#pragma GCC diagnostic pop
}
#endif // #ifndef _BOOT_MODE