[hatari-devel] fix a warning for debugui.c |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: [hatari-devel] fix a warning for debugui.c
- From: benoît tuduri <benoit.tuduri@xxxxxxxxx>
- Date: Fri, 9 Feb 2018 12:16:06 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=2eyGIC/mL+X1SODvyB5fzltKsCWbVTcr6ZWHUgBtuG0=; b=kip04xHFAikrQT+9bleEZBxMkf+5QtzhVrYVjS7267BIoJXJEjDIPamzQd5/lCBhMB YpaiQQklFMZA82G0F75OqfpPyBHT1hv5OfXNfXgcExnGkcvAnhGlo8r2pj91xq44nF2S EL7zOU8loVU/9ayCDTGQK6PRlTF5DoC/zDg/c+Rs2PNdlwmU6uzhKKlXDyWkL/UYsqAK xuWMbIpcqijs95GOhte2P4E18vf4fiHPHQkamRlE5NB9Y9jj/txzE+rkuDcHeRwv+jCG +nwqnPJsDMoZ3xSgyHU8xtI2kmi92lhMka71SIs8DjMjWYWo/ybC1U8B9gLXGojlFyqM Z7vg==
Hello,
LLVM report a warning with the Hatari string and the rl_readline_name
type conflict.
The fixes seems fix it. It's in a attachment
Regards,
# HG changeset patch
# User Benoît Tuduri <benoit.tuduri@xxxxxxxxx>
# Date 1518174327 -3600
# Fri Feb 09 12:05:27 2018 +0100
# Node ID 9ac8246f1016d80e371056ce2b32971579d726ce
# Parent d8612f8264c6dc9d9c0c1bbd39d0e0179a821f55
ifix the debugui.c warning : warning: assigning to
'char *' from 'const char [7]' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
rl_readline_name = "Hatari";
^ ~~~~~~~~
diff -r d8612f8264c6 -r 9ac8246f1016 src/debug/debugui.c
--- a/src/debug/debugui.c Thu Feb 08 17:04:28 2018 +0100
+++ b/src/debug/debugui.c Fri Feb 09 12:05:27 2018 +0100
@@ -12,6 +12,7 @@
#include <ctype.h>
#include <stdio.h>
+#include <string.h>
#include <unistd.h>
#include "config.h"
@@ -810,7 +811,7 @@
static char *DebugUI_GetCommand(char *input)
{
/* Allow conditional parsing of the ~/.inputrc file. */
- rl_readline_name = "Hatari";
+ strncpy(rl_readline_name, "Hatari", 6);
/* Tell the completer that we want a crack first. */
rl_attempted_completion_function = DebugUI_Completion;