David already helped me to find a really silly error in a previous
version.

When I try the stuff in
http://danny.backx.info/download/cegcc/wm61.tar.gz I get different
results on different devices.

I would expect the application to report the value 3 three times, but it
doesn't. This is with the code in SVN.

Does anyone see what the problem is ?

Thanks,

        Danny

pavilion: {248} tar tvfz /tmp/wm61.tar.gz
drwxrwxr-x danny/danny       0 2010-03-05 20:53 ./
-rw-rw-r-- danny/danny    2278 2010-03-05 20:53 ./t.o
-rw-rw-r-- danny/danny     177 2010-03-04 22:46 ./t.c
-rwxrwxr-x danny/danny   31086 2010-03-05 20:53 ./l.dll
-rw-rw-r-- danny/danny  121010 2010-03-05 20:53 ./l.dll.objdump
-rw-rw-r-- danny/danny     442 2010-03-04 22:48 ./main.c
-rw-rw-r-- danny/danny    2589 2010-03-05 20:53 ./l.o
-rwxrwxr-x danny/danny   31022 2010-03-05 20:53 ./t.dll
-rw-rw-r-- danny/danny    2621 2010-03-05 20:53 ./main.o
-rw-rw-r-- danny/danny  242699 2010-03-05 20:53 ./t.dll.od
-rw-rw-r-- danny/danny    1459 2010-03-05 20:07 ./Makefile
-rwxrwxr-x danny/danny   29106 2010-03-05 20:53 ./main.exe
-rw-rw-r-- danny/danny  121536 2010-03-05 20:53 ./t.dll.objdump
-rw-rw-r-- danny/danny  239433 2010-03-05 20:53 ./l.dll.od
-rw-rw-r-- danny/danny     235 2010-03-04 22:45 ./l.c
pavilion: {249} ls -l /tmp/wm61.tar.gz 
-rw-rw-r-- 1 danny danny 174685 2010-03-05 20:54 /tmp/wm61.tar.gz
pavilion: {250} more *.c
::::::::::::::
l.c
::::::::::::::
#include <windows.h>

int a[5] = { 3, 4, 5, 6, 0 };

void foo(void)
{
        a[0] = 1;
        a[1] = 2;
        a[2] = 3;
        a[3] = 0;
}

void localquery(void)
{
        wchar_t s[32];

        wsprintf(s, L"localquery() -> %d", a[0]);
        MessageBoxW(0, s, L"info", 0);
}
::::::::::::::
main.c
::::::::::::::
#ifdef __UNDER_CE__
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>

extern int fun(void);

#ifdef __UNDER_CE__
int APIENTRY WinMain(HINSTANCE inst, HINSTANCE pi, LPWSTR cmd, int show)
{
        int x;
        wchar_t s[32];

        localquery();
        x = fun();
        wsprintf(s, L"fun() -> %d", x);
        MessageBox(0, s, L"info", 0);
        return 0;
}
#else
int main(int argc, char *argv[])
{
        int x = fun();

        printf("fun() -> %d\n", x);
        return 0;
}
#endif
::::::::::::::
t.c
::::::::::::::
#include <windows.h>

extern int a[];

int fun(void)
{
        wchar_t s[32];
        int     r;

        r = a[0];

        wsprintf(s, L"remote query -> %d", r);
        MessageBoxW(0, s, L"info", 0);
        return r;
}
pavilion: {251} 
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to