- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Tags:
- Bug
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can add -wd711 to your command line to turn off this warning.
Regards,
Viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Viet,
Is there any specific reason that causes this warning? I prefer not disabling warnings for all variadic functions.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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'); }

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page