[PATCH 00/44] Eliminate nearly all warnings from a normal build

Keith Packard keithp at keithp.com
Wed Dec 11 12:23:32 PST 2013


Here's a huge sequence of patches that eliminates hundreds of compiler
warnings, leaving us with a handful of printf non-constant format
warnings and the expected warnings from the test suite. One patch in
the series disables building DMX by default as that is chock-full of
painful problems. Fixes to those warnings would be greatly
appreciated.

Oh, this also requires fixes to external packages, including the
xproto package, drm library and util macros (to eliminate -Wcast-qual)

-keith

log.c: In function 'LogInit':
log.c:198:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
         if (asprintf(&logFileName, fname, display) == -1)
         ^
log.c:208:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
                 if ((asprintf(&suffix, backup, display) == -1) ||
                 ^

lnx_init.c: In function 'xf86OpenConsole':
lnx_init.c:158:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
             snprintf(vtname, sizeof(vtname), vcs[i], xf86Info.vtno);    /* /dev/tty1-64 */
             ^
lnx_init.c:158:13: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]

signal-logging.c:223:2: warning: #warning Ignore compiler warning below "lacks type at end of format". This is intentional. [-Wcpp]
 #warning Ignore compiler warning below "lacks type at end of format".  This is intentional.
  ^
signal-logging.c:230:2: warning: #warning Ignore compiler warning below "unknown conversion type character". This is intentional. [-Wcpp]
 #warning Ignore compiler warning below "unknown conversion type character".  This is intentional.
  ^
signal-logging.c: In function ‘number_formatting’:
signal-logging.c:125:44: warning: large integer implicitly truncated to unsigned type [-Woverflow]
                                            0x15D027BF211B37A, /* Large > 32 bit number */
                                            ^
signal-logging.c:126:44: warning: large integer implicitly truncated to unsigned type [-Woverflow]
                                            0xFFFFFFFFFFFFFFFF, /* Maximum 64-bit number */
                                            ^
signal-logging.c:134:33: warning: overflow in implicit constant conversion [-Woverflow]
                                 0x15D027BF211B37A, /* Large > 32 bit number */
                                 ^
signal-logging.c:135:33: warning: overflow in implicit constant conversion [-Woverflow]
                                 0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */
                                 ^
signal-logging.c:139:33: warning: overflow in implicit constant conversion [-Woverflow]
                                 -0x15D027BF211B37A, /* Large > 32 bit number */
                                 ^
signal-logging.c:140:33: warning: overflow in implicit constant conversion [-Woverflow]
                                 -0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */
                                 ^
signal-logging.c: In function ‘logging_format’:
signal-logging.c:211:5: warning: unknown conversion type character ‘Q’ in format [-Wformat=]
     LogMessageVerbSigSafe(X_ERROR, -1, "test %Q\n");
     ^
signal-logging.c:224:5: warning: conversion lacks type at end of format [-Wformat=]
     LogMessageVerbSigSafe(X_ERROR, -1, "%4", 4);
     ^
signal-logging.c:224:5: warning: too many arguments for format [-Wformat-extra-args]
signal-logging.c:232:5: warning: unknown conversion type character ‘l’ in format [-Wformat=]
     LogMessageVerbSigSafe(X_ERROR, -1, "%hld\n", 4);
     ^
signal-logging.c:232:5: warning: too many arguments for format [-Wformat-extra-args]


More information about the xorg-devel mailing list