Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » "function called through a non-compatible type" when activating diags_ENTRY
"function called through a non-compatible type" when activating diags_ENTRY [message #417] Wed, 26 November 2008 11:28 Go to next message
Fuchs Clemens is currently offline Fuchs ClemensFriend
Messages: 3
Registered: July 2009
Junior Member
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 17:19 Go to previous messageGo to next message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
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 22:09 Go to previous message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
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.
Previous Topic:RTSC and POSIX
Next Topic:Dumping modules/interfaces in a package
Goto Forum:
  


Current Time: Thu Mar 28 20:05:43 GMT 2024

Powered by FUDForum. Page generated in 0.03969 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top