Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Yakov_Mindelis
Beginner
139 Views

"warning #711: ellipsis with no explicit parameters is nonstandard" with "-strict-ansi"

Hello,

 

With upgrade to icc18.0.1 the following warning appears when "-strict-ansi" argument is supplied:

icc18_toupper_test.c(6): warning #711: ellipsis with no explicit parameters is nonstandard
  	v = toupper(v);
  	    ^


With icc15 this message did not appear.

Compiler  is installed x86_64 Linux.

 

The code is attached, compilation cmd:
icc -strict-ansi icc18_toupper_test.c

 

How do I get rid of this warning?

Thanks

0 Kudos
3 Replies
Viet_H_Intel
Moderator
139 Views

Hi,

You can add -wd711 to your command line to turn off this warning.

Regards,

Viet

Yakov_Mindelis
Beginner
139 Views

Hi Viet,

Is there any specific reason that causes this warning? I prefer not disabling warnings for all variadic functions.

Thanks

nemequ
New Contributor I
139 Views

With glibc, your code gets preprocessed to something like

int main(void)
{
    unsigned char v = 'a';
    v = (__extension__({
        int __res;
        if (sizeof(v) > 1)
        {
            if (__builtin_constant_p(v))
            {
                int __c = (v);
                __res = __c < -128 || __c > 255 ? __c
                                                : (*__ctype_toupper_loc())[__c];
            } else
                __res = toupper(v);
        } else
            __res = (*__ctype_toupper_loc())[(int)(v)];
        __res;
    }));
    return (0);
}

If we run it through the compiler (with -strict-ansi), the warning gets triggered on the __builtin_constant_p call. __builtin_constant_p is type-generic, so I guess the compiler implements it internally just like a variadic function. The problem can be triggered a bit more simply (and without depending on glibc) with:

int main(void) {
  return __builtin_constant_p('a');
}
Reply