Ignore a couple of format-nonliteral warnings

These are generated in code which uses sprintf as a convenient way to
construct strings from various pieces.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Keith Packard 2013-12-13 11:24:00 -08:00
parent 9ef53e2267
commit 1ad8d12e7f
2 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,7 @@ xf86OpenConsole(void)
i = 0;
while (vcs[i] != NULL) {
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
snprintf(vtname, sizeof(vtname), vcs[i], xf86Info.vtno); /* /dev/tty1-64 */
if ((xf86Info.consoleFd = open(vtname, O_RDWR | O_NDELAY, 0)) >= 0)
break;

View File

@ -195,6 +195,7 @@ LogInit(const char *fname, const char *backup)
char *logFileName = NULL;
if (fname && *fname) {
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
if (asprintf(&logFileName, fname, display) == -1)
FatalError("Cannot allocate space for the log file name\n");
@ -205,6 +206,7 @@ LogInit(const char *fname, const char *backup)
char *suffix;
char *oldLog;
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
if ((asprintf(&suffix, backup, display) == -1) ||
(asprintf(&oldLog, "%s%s", logFileName, suffix) == -1))
FatalError("Cannot allocate space for the log file name\n");