Hello Danny!
On Sat, 6 Oct 2007, Danny Backx wrote:
> On Fri, 2007-10-05 at 22:26 +0200, Vitus Jensen wrote:
>>
>> I'm trying to port a small testprogramm from embedded Visual C 4 to
>> mingw32ce (cegcc-mingw32ce-0.50-1.i586.rpm). It's text mode, 2 threads,
>> some printf, some files, nothing fancy but ... it has to use 2 object
>> libraries (3rd party) and a DLL (my own).
>>
>> I'm able to compile and link this programm but when I call the 3rd party
>> library an important call fails. It's the only call with several
>> parameters so I suspect different calling conventions.
>>
>> Goes like this:
>>
>> extern int libconfig(int hd, int subfct, void * parameter);
>>
>> test()
>> {
>> hd = libopen();
>> res = libconfig(hd, 1, (void *)0815);
>> res = libconfig(hd, 2, (void *)15);
>> ...
>> libclose(hd);
>> }
>>
>> Result code indicates "invalid subfunction" :-(
>>
>> The prototype shows no "__syscall" or the like, the object library works
>> when used with eVC. I've looked at the produced assembler code in the eVC
>> debugger and it seems parameters are transfered via r0, r1 and r2. Isn't
>> this the same as in mingw32ce? In my opinion all this indicates that the
>> program should work. It doesn't :-(
>
> This is probably a silly remark but "0815" is an invalid number. The GNU
> C compiler will treat any number that starts with a 0 as octal. In
> octal, there's no 8, so the compiler issues an error :
> tt.c:8:33: error: invalid digit "8" in octal constant
Well, as you might have suspected, that code has never seen a compiler :-)
It was typed directly into the mail. And function names a little
different, but type and count of arguments are exactly the same. Only 4
functions are available: open(), set(), get() and close().
> In case that that isn't your problem, I've attached a source and
> assembler file generated by arm-wince-mingw32ce-gcc . Which assembler
> instructions does eVC generate for this file ?
I will have a look via eVC on monday when I'm back at work. I will be
using the debugger and cut'n waste, as I find it hard to go through all
those menues to find an option to generate assembler output.
Thank you for your mail!
Vitus
--
Vitus Jensen, Hannover, Germany, ICQ 122355880
pgp public key available from keyservers
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Cegcc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel