Re: ver 4.0 c_func problem on WIN98 Here Is proof of the problem !

new topic     » goto parent     » topic index » view thread      » older message » newer message
bernie said...

My code does not have any thing to do with changing the return type.

Not the return type, but (the C variable that is internal to Euphoria) return_type.

bernie said...

If you will note that the return type is set up in the define_c_func by a C_ULONG which is NOT controlled by my program code but internally by Euphoria.

This information (the C_ULONG) is stored in return_type, however, so if return_type gets changed then the information is lost. Watcom makes the return_type variable the same as the ESI register.

bernie said...

No matter what is done to the ESI register internally in my code; it should not effect the external Euphoria code.

What Matt is saying is that your machine code is clobbering a register.

If you saved all registers before your machine code starts and then restored all registers before your machine code returns, that would fix the bug.

Now the question is, is the bug Watcom's fault or not? In other words, should the compiler be saving and restoring registers for us or is your machine code suppose to do that? This is beyond the internals of Euphoria, but entering the realm of the internals of Watcom C, the realm of the Watcom developer team.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu