- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do I report a compiler bug? We're getting warnings all over our code so we've had to disable some type-checking. The warnings are wrong, and the MSVC compiler correctly allows the code without complaint. It's not the end of the world, it would just be nice to get real warnings back without having to wade through the bogus ones.
(Hopefully this forum will mail me replies, since I'm unlikely to check back otherwise...)
(Hopefully this forum will mail me replies, since I'm unlikely to check back otherwise...)
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Stuart Ferguson
The test code follows. Compiled as C (not C++) we get no warnings on case 1, but warnings on 2 and 3. All three cases are logically equivalent as far as I can see. The end result is that the pointer to double is cast to void pointer, and then foo() is called with a void pointer. If there are hidden ramifications for optimization it would be interesting to know what they are. This is something we do EVERYWHERE and is basically how we implement poor-man's templates in ordinary C.
Intel Compiler does emit much more diagnostic message than VS. But we're trying to be compatible as well.
In 11.1 the Intel C++ Compiler has provided another option /W5 to display all the warnings. But default /W3 should match VS.
I'll file a bug to move those warnings to /W5.
For now you can work-around it:
[cpp] typedef int (*myfuncType) (void *); myfuncType func; func = (myfuncType) foo;[/cpp]
Thanks,
Jennifer
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you haven't registered your license key, or previously opened a support account, do so at https://registrationcenter.intel.com
Then you will automatically get an account on https://premier.intel.com where you would submit a bug report.
Then you will automatically get an account on https://premier.intel.com where you would submit a bug report.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Stuart Ferguson
How do I report a compiler bug? We're getting warnings all over our code so we've had to disable some type-checking. The warnings are wrong, and the MSVC compiler correctly allows the code without complaint. It's not the end of the world, it would just be nice to get real warnings back without having to wade through the bogus ones.
(Hopefully this forum will mail me replies, since I'm unlikely to check back otherwise...)
(Hopefully this forum will mail me replies, since I'm unlikely to check back otherwise...)
More warnings is not considered a bug unless they are incorrect (and bogus != incorrect).
Intel compiler is doing a bit more checking for ambiguous statements/constructs in the code than the MSVC, and the reason for this is optimization -- if code is ambiguous to compiler it cannot optimize it safely. That is why you get the warnings. Warning level can be changed, and the individual warnings and remarks can be suppressed just like in MSVC. Of course the best way is to fix the code, but that usually involves some restructuring and rethinking of data flow and the associated datatypes used for storage and intermediate results.
I dare you to try running lint on your code and see how many warnings you get.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
If you haven't registered your license key, or previously opened a support account, do so at https://registrationcenter.intel.com
Then you will automatically get an account on https://premier.intel.com where you would submit a bug report.
Then you will automatically get an account on https://premier.intel.com where you would submit a bug report.
Thank you. I hadn't been able to find that site by following links. I've filed my report.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Igor Levicki
More warnings is not considered a bug unless they are incorrect (and bogus != incorrect).
[...]
I dare you to try running lint on your code and see how many warnings you get.
Because of the way our code is structured we get tens of thousands of warnings for something we believe to be perfectly legal, and which would require either wholesale casting (thus missing the point of type-checking) or significant (and functionally pointless) rewrites to tame. Currently we have to have warnings 167 and 556 suppressed, which means that we miss the few legitimate type-conversion errors because we can't afford to wade through the "bogus" ones. Some of these warnings are correct and some are not, and there's no way to turn off the incorrect ones. Even if they just had different error code numbers that would be a great improvement.
The test code follows. Compiled as C (not C++) we get no warnings on case 1, but warnings on 2 and 3. All three cases are logically equivalent as far as I can see. The end result is that the pointer to double is cast to void pointer, and then foo() is called with a void pointer. If there are hidden ramifications for optimization it would be interesting to know what they are. This is something we do EVERYWHERE and is basically how we implement poor-man's templates in ordinary C.
---- test.c
int foo (double *ptr)
{
return ptr[0] > 0.0;
}
int fooFoo (int (*func) (void *), void *data)
{
return func (data);
}
int main ()
{
int (*func) (void *);
void *vp;
double d;
// case 1: no warnings
vp = &d;
foo (vp);
// case 2: warning 556
func = foo;
func (&d);
// case 3: warning 167
fooFoo (foo, &d);
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Stuart Ferguson
The test code follows. Compiled as C (not C++) we get no warnings on case 1, but warnings on 2 and 3. All three cases are logically equivalent as far as I can see. The end result is that the pointer to double is cast to void pointer, and then foo() is called with a void pointer. If there are hidden ramifications for optimization it would be interesting to know what they are. This is something we do EVERYWHERE and is basically how we implement poor-man's templates in ordinary C.
Intel Compiler does emit much more diagnostic message than VS. But we're trying to be compatible as well.
In 11.1 the Intel C++ Compiler has provided another option /W5 to display all the warnings. But default /W3 should match VS.
I'll file a bug to move those warnings to /W5.
For now you can work-around it:
[cpp] typedef int (*myfuncType) (void *); myfuncType func; func = (myfuncType) foo;[/cpp]
Thanks,
Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Jennifer Jiang (Intel)
In 11.1 the Intel C++ Compiler has provided another option /W5 to display all the warnings. But default /W3 should match VS.
I'll file a bug to move those warnings to /W5.
I'll file a bug to move those warnings to /W5.
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