bug in xman/handler.c: array compared to NULL

Thomas Klausner wiz at NetBSD.org
Sun Mar 30 09:48:19 PDT 2014


Hi!

clang rightfully complains about this code in handler.c:

void
SaveFormattedPage(Widget w, XEvent * event, String * params,
                  Cardinal * num_params)
{   
    ManpageGlobals *man_globals;
    char cmdbuf[BUFSIZ], error_buf[BUFSIZ];

    if (*num_params != 1) {
        XtAppWarning(XtWidgetToApplicationContext(w), 
                     "Xman - SaveFormattedPage: This action routine requires one argument.");
        return;    
    }
 
    man_globals = GetGlobals(w);
    if (man_globals->tempfile == NULL)
        return;

handler.c:323:22: error: comparison of array 'man_globals->tempfile' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]

since tempfile is declared as
    char tempfile[80];          /* the name of the file to copy the formatted
                                   page from. */

Does anyone know what the intended check is or should I just remove
the comparison?
 Thomas


More information about the xorg-devel mailing list