From 3c9b60c1fb144950ca51220ffa18f485672c3ba6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 7 Nov 2006 08:36:14 +0100 Subject: [PATCH] [PATCH] Warn on writable strings Signed-off-by: Jens Axboe --- Makefile | 2 +- fio.c | 2 +- fio.h | 2 +- init.c | 4 ++-- parse.h | 2 +- stat.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2746ce72..ad9aa3bd 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -W -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +CFLAGS = -W -Wwrite-strings -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 PROGS = fio SCRIPTS = fio_generate_plots OBJS = fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o \ diff --git a/fio.c b/fio.c index 011c13a3..8c059df6 100644 --- a/fio.c +++ b/fio.c @@ -45,7 +45,7 @@ int groupid = 0; int thread_number = 0; int shm_id = 0; int temp_stall_ts; -char *fio_inst_prefix = _INST_PREFIX; +const char *fio_inst_prefix = _INST_PREFIX; static volatile int startup_sem; diff --git a/fio.h b/fio.h index b94bf431..434c34b2 100644 --- a/fio.h +++ b/fio.h @@ -356,7 +356,7 @@ extern int groupid; extern int terse_output; extern FILE *f_out; extern FILE *f_err; -extern char *fio_inst_prefix; +extern const char *fio_inst_prefix; extern int temp_stall_ts; extern struct thread_data *threads; diff --git a/init.c b/init.c index 0352c555..54e2ecae 100644 --- a/init.c +++ b/init.c @@ -539,8 +539,8 @@ static char *to_kmg(unsigned int val) */ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) { - char *ddir_str[] = { "read", "write", "randread", "randwrite", - "rw", NULL, "randrw" }; + const char *ddir_str[] = { "read", "write", "randread", "randwrite", + "rw", NULL, "randrw" }; struct stat sb; int numjobs, ddir, i; struct fio_file *f; diff --git a/parse.h b/parse.h index 9b34de9a..adbb3208 100644 --- a/parse.h +++ b/parse.h @@ -19,7 +19,7 @@ enum fio_opt_type { * Option define */ struct fio_option { - char *name; + const char *name; enum fio_opt_type type; unsigned int off1; unsigned int off2; diff --git a/stat.c b/stat.c index 0ae19b28..0ccf37e7 100644 --- a/stat.c +++ b/stat.c @@ -333,7 +333,7 @@ static void show_disk_util(void) static void show_ddir_status(struct thread_data *td, struct group_run_stats *rs, int ddir) { - char *ddir_str[] = { "read ", "write" }; + const char *ddir_str[] = { "read ", "write" }; unsigned long min, max; unsigned long long bw; double mean, dev; -- 2.25.1