From ef02006b0131f298595b37afb07562ee50fae5cc Mon Sep 17 00:00:00 2001 From: "Alan D. Brunelle" Date: Wed, 12 Nov 2008 07:11:22 -0500 Subject: [PATCH] gcc 4.3.2 has started to warn about: MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc -Wall -W -O2 -g -I. -I.. -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c -o output.o output.c output.c: In function ‘output_section_hdr’: output.c:57: warning: format not a string literal and no format arguments output.c: In function ‘__output_pip_avg’: output.c:496: warning: format not a string literal and no format arguments output.c:496: warning: format not a string literal and no format arguments so this patch cleans this up. --- btt/output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/btt/output.c b/btt/output.c index 00ffce5..c08e7da 100644 --- a/btt/output.c +++ b/btt/output.c @@ -54,7 +54,7 @@ ai_pip_t pip_d2c_avg(struct p_info *pip) { return &pip->avgs.d2c; } void output_section_hdr(FILE *ofp, char *hdr) { fprintf(ofp, "==================== "); - fprintf(ofp, hdr); + fprintf(ofp, "%s", hdr); fprintf(ofp, " ====================\n\n"); } @@ -493,7 +493,7 @@ void __output_pip_avg(struct p_info *pip, void *arg) if (ap->n > 0) { char proc_name[15]; - snprintf(proc_name, 15, pip->name); + snprintf(proc_name, 15, "%s", pip->name); ap->avg = BIT_TIME(ap->total) / (double)ap->n; __output_avg(opap->ofp, proc_name, ap, 0); -- 2.25.1