gcc3.3.3 compiling question.

AaronL alee at IfA.Hawaii.Edu
Thu Oct 21 20:55:08 PDT 2004


Hi,

I was compiling libxml-1.8.17 and noticed ALOT of warnings scrolling by, 
such as:

valid.c: In function `xmlValidateNmtokenValue':
valid.c:2140: warning: comparison is always true due to limited range of 
data type
valid.c:2147: warning: comparison is always true due to limited range of 
data type


The function source is:

/**
 * xmlValidateNmtokenValue:
 * @value:  an Mntoken value
 *
 * Validate that the given value match Nmtoken production
 *
 * [ VC: Name Token ]
 *
 * returns 1 if valid or 0 otherwise
 */

int
xmlValidateNmtokenValue(const xmlChar *value) {
    const xmlChar *cur;

    if (value == NULL) return(0);
    cur = value;
   
    if (!IS_LETTER(*cur) && !IS_DIGIT(*cur) &&      <===== line 2140
        (*cur != '.') && (*cur != '-') &&
        (*cur != '_') && (*cur != ':') &&
        (!IS_COMBINING(*cur)) &&
        (!IS_EXTENDER(*cur)))
        return(0);

    while ((IS_LETTER(*cur)) || (IS_DIGIT(*cur)) ||
           (*cur == '.') || (*cur == '-') ||
           (*cur == '_') || (*cur == ':') ||
           (IS_COMBINING(*cur)) ||
           (IS_EXTENDER(*cur)))
           cur++;

    if (*cur != 0) return(0);

    return(1);
}


Is this a problem with my compiler?



More information about the blfs-support mailing list