"function called through a non-compatible type" when activating diags_ENTRY [message #417] |
Wed, 26 November 2008 06:28  |
Eclipse User |
|
|
|
Hi,
when activating diagnosis support like described in the user's guide
(Defaults.common$.diags_ENTRY = Diags.RUNTIME_ON;), I get following error
for all function calls when compiling:
package/cfg/Test_x86GW.c:18914: warning: function called through a
non-compatible type
package/cfg/Test_x86GW.c:18914: note: if this code is reached, the program
will abort
I use mingw32-gcc-3.4.5, did anybody experience similar problems?
thanks,
Clemens
|
|
|
Re: "function called through a non-compatible type" when activating diags_ENTRY [message #422 is a reply to message #417] |
Wed, 26 November 2008 12:19   |
Eclipse User |
|
|
|
Clemens Fuchs wrote:
> Hi,
>
> when activating diagnosis support like described in the user's guide
> (Defaults.common$.diags_ENTRY = Diags.RUNTIME_ON;), I get following
> error for all function calls when compiling:
>
> package/cfg/Test_x86GW.c:18914: warning: function called through a
> non-compatible type
> package/cfg/Test_x86GW.c:18914: note: if this code is reached, the
> program will abort
>
> I use mingw32-gcc-3.4.5, did anybody experience similar problems?
>
> thanks,
> Clemens
>
I can't reproduce the problem. Goggling the warning from gcc suggests
that the compiler has detected a call through a function pointer whose
type signature does not match the arguments being passed.
Log diagnostics does call an underlying "Logger" function via a function
pointer, so it seems likely this is the source of the warning. But
since I don't get this warning, I wonder if you are passing additional
"strict" options to the compiler?
The Test_x86GW.c file is a generated file and it's possible that we need
to add an appropriate cast around arguments being passed to the logger.
Finally, if you can send me the Test_x86GW.c file (d-russo at ti.com),
it would help us diagnose the problem.
|
|
|
Re: "function called through a non-compatible type" when activating diags_ENTRY [message #682 is a reply to message #417] |
Fri, 28 November 2008 17:09  |
Eclipse User |
|
|
|
Clemens Fuchs wrote:
> Hi,
>
> when activating diagnosis support like described in the user's guide
> (Defaults.common$.diags_ENTRY = Diags.RUNTIME_ON;), I get following
> error for all function calls when compiling:
>
> package/cfg/Test_x86GW.c:18914: warning: function called through a
> non-compatible type
> package/cfg/Test_x86GW.c:18914: note: if this code is reached, the
> program will abort
>
> I use mingw32-gcc-3.4.5, did anybody experience similar problems?
>
> thanks,
> Clemens
>
We've finally been able to reproduce the problem. It looks like we have
a bug that shows up when you use the MinGW compiler with the "release"
profile.
A workaround until we fix the problem is to add the following line to
either your config.bld of package.bld scripts:
Pkg.attrs.profile = "debug";
This will set the default compilation profile to "debug" (it normally
defaults to "release"). Apparently gcc does more complete type analysis
when you compile with -O2 than if you compile with -g.
Although the generated .c file from the configuration step casts
function pointers to the correct types, gcc (when run with -O2) requires
that we first cast function pointers to (void *) before casting them to
the "right" type.
|
|
|
Powered by
FUDForum. Page generated in 0.07243 seconds