[m-rev.] diff: avoid a warning from clang in trace library

Julien Fischer jfischer at opturion.com
Thu Mar 20 15:41:30 AEDT 2014


Branches: master, 14.01

-----------------------

Avoid a warning from clang.

trace/mercury_trace_readline.c:
 	Replace a call to fprintf with a call to fputs.  This avoids
 	a warning from clang about a format string not being a string
 	literal.

Julien.

diff --git a/trace/mercury_trace_readline.c b/trace/mercury_trace_readline.c
index 05d266a..37f919f 100644
--- a/trace/mercury_trace_readline.c
+++ b/trace/mercury_trace_readline.c
@@ -102,7 +102,7 @@ MR_trace_readline(const char *prompt, FILE *in, FILE *out)
              pre_prompt = (char *) MR_malloc(last_nl - prompt + 2);
              strncpy(pre_prompt, prompt, last_nl - prompt + 1);
              pre_prompt[last_nl - prompt + 1] = '\0';
-            fprintf(out, pre_prompt);
+            fputs(pre_prompt, out);
              line = readline((char *) real_prompt);
              MR_free(real_prompt);
              MR_free(pre_prompt);



More information about the reviews mailing list