[hatari-devel] fix a warning for debugui.c

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


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;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/