- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
compiling this tiny program, prog1.cpp:
int cos_sin();
int main()
{
int x = cos_sin();
}
I was getting this compiler error:
prog1.cpp(5): error: argument is incompatible with formal parameter
int x = cos_sin();
^
Intel C++ Intel 64 Compiler XE for applications running on
Intel 64, Version 12.0.4.191 Build 20110427
Copyright (C) 1985-2011 Intel Corporation.
Slackware Linux 64bit
Kernel version 2.6.37.6
What can I do to correct this?
Thanks.
Tamas Istvan
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There's no problem with your program, it's a bug in the compiler. I've filed an Intel-internal bug tracking report about it.
The bug in the compiler is that it mistakes cos_sin as an intrinsic, and ignores the function prototype. The suggested workaround is that you avoid using the identifier cos_sin.
Best regards, Melanie
The bug in the compiler is that it mistakes cos_sin as an intrinsic, and ignores the function prototype. The suggested workaround is that you avoid using the identifier cos_sin.
Best regards, Melanie
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a bug in the compiler, we're recognizing cos_sin as an intrinsic rather than a user-defined function. I filed cq172664 to track it. Thanks for reporting this problem.
I find that the bug is only active when compiling c++: compiling as a .c file with icc doesn't expose the problem. (mv prog1.cpp prog1.c ; icc -c prog1.c)
So workaround is to compile as a .c file, if possible. Or use a different identifier for the function name.
--Melanie Blower
C/C++ front end developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the answer. But what the problem with the 'cos_sin()' function name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There's no problem with your program, it's a bug in the compiler. I've filed an Intel-internal bug tracking report about it.
The bug in the compiler is that it mistakes cos_sin as an intrinsic, and ignores the function prototype. The suggested workaround is that you avoid using the identifier cos_sin.
Best regards, Melanie
The bug in the compiler is that it mistakes cos_sin as an intrinsic, and ignores the function prototype. The suggested workaround is that you avoid using the identifier cos_sin.
Best regards, Melanie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You do not need to change your code. Just use the -fno-builtin-cos_sin option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now its works fine.
Thank you.

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