Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

How do I report a compiler bug?

Stuart_Ferguson
Beginner
423 Views
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...)
0 Kudos
1 Solution
JenniferJ
Moderator
423 Views
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.
Hi,
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

View solution in original post

0 Kudos
6 Replies
TimP
Honored Contributor III
423 Views
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.
0 Kudos
levicki
Valued Contributor I
423 Views
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...)

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.

0 Kudos
Stuart_Ferguson
Beginner
423 Views
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.

Thank you. I hadn't been able to find that site by following links. I've filed my report.
0 Kudos
Stuart_Ferguson
Beginner
423 Views
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.

Thanks for the reply. We always try to fix compiler warnings in our code which is why this is a concern. If we wanted to run lint we would, but that's not what we need from a compiler. It's a product that we expect to be able to be able to tune to give us useful information.

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;
}

0 Kudos
JenniferJ
Moderator
424 Views
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.
Hi,
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
0 Kudos
Stuart_Ferguson
Beginner
423 Views
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.

That's great! Thanks for the help. I'll look forward to the next update of 11.1.
0 Kudos
Reply