From 3bb4600164bb38f80073228ea4a178c4466f158c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 28 Jan 2015 22:22:49 +0000 Subject: [PATCH] Fix the following -Wcast-qual warnings in usr.sbin/sa/db.c: usr.sbin/sa/db.c:82:20: error: cast from 'char const (*)[9]' to 'void *' drops const qualifier [-Werror,-Wcast-qual] key.data = (void*)&VERSION_KEY; ^ usr.sbin/sa/db.c:178:20: error: cast from 'char const (*)[9]' to 'void *' drops const qualifier [-Werror,-Wcast-qual] key.data = (void*)&VERSION_KEY; ^ Replace the VERSION_KEY define with a writable char array, so no const qualifier needs to be dropped anymore. Submitted by: rdivacky --- usr.sbin/sa/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/sa/db.c b/usr.sbin/sa/db.c index 557f406436e..6634e542fd8 100644 --- a/usr.sbin/sa/db.c +++ b/usr.sbin/sa/db.c @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" /* Key used to store the version of the database data elements. */ -#define VERSION_KEY "\0VERSION" +static char VERSION_KEY[] = "\0VERSION"; /* * Create the in-memory database, *mdb.