On Tue, Nov 4, 2014 at 12:28 PM, David Macek <[email protected]> wrote:
> On 4. 11. 2014 13:07, Gintautas Miliauskas wrote:
>> But running it just prints "hi", no indications of a crash or anything, 
>> regardless of the value of the MSYS variable:
>
> Either the compiler, or C library is too smart for this. I'd guess your 
> compiler is working with undefined behavior optimizations, because with my 
> compiler, I get both "hi" and "bye" (or not, when I pass -Og). Try this code:
>
> #include <stdio.h>
> int main() {
>   printf("hi\n");
>   ((void(*)())(0))();
>   printf("bye\n");
>   return 0;
> }

My favourite make-it-crash dance has always been "*(int*)3 = 0;", I've
never found a system that's happy with that rubbish!

>
>
> --
> David Macek
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Msys2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/msys2-users

------------------------------------------------------------------------------
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to