mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] shifting crashes


From: Manner Róbert
Subject: Re: [Mingw-cross-env-list] shifting crashes
Date: Thu, 23 May 2019 09:41:24 +0200

I would instead suspect things like "a" is pointing to some not
allocated memory area (eg stack gets corrupted beforehand) and when it
is working, it is luck.
Having a compiler issue is much less likely. You might be able to find
out more with gdb, its included in mxe, just build it like "make gdb".

Some valgrind like tool could be also helpful, but I am not aware of any
for win.

Robert

On 5/22/19 7:52 AM, Daniel Wienzek wrote:
> Hello.
> 
> I'm trying to build 'Other-Life' [https://github.com/pjbroad/other-life]
> with mxe.
> The code contains 'left shift' expressions like:
> 
> *    a = (1 << n);*
> 
> which crashes on win7 i686, but works fine under 'wine'. [built with
> i686-w64]
> The x86_64-w64 code works find under Windows.
> 
> I've tried gcc 5/6.
> Building a test executable  with just the following works:
> 
> *    v = atoi(argv[1]);
>     printf("\n 1 << %u = 0x%08x\n",v, (1 << v));*
> 
> Also if i replace the *1* in the other-life code with an unsigned
> integer like:
> 
> *    unsigned int b = 1;**
> **    a = ( b << n );*
> 
> there is no crash.
> 
> Is it because of shfting 1 (constant?) ?
> 
> 
> Greetings, Daniel
> 
> 
> 
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]