On Wed, 11 Jul 2018 at 11:10, U.Mutlu wrote: > > Mahmood Naderan via gcc-help wrote on 07/11/2018 08:57 AM: > >> Sorry, I don't get your point. > >> What else do you expect to happen? > > > > > > I don't expect a crash. Why? because the strcpy should simply copy an item to memory location. I wonder why it says "I can not access the memory location where is memory location is the data value"?!!! > > Why on earth strcpy wants to access a memory location where I didn't tell him to access? > > Just a guess: because after strcpy has overwritten the stack, the > (internal/hidden) register restorations now point to illegal addresses...? > > > Moreover, as I said multiple times, why w/o specifying -m32, the program finishes without error? > > People told you that there is a difference in 64bit/32bit stack layout... > And people also told you that undefined behaviour does not mean you should get predictable or consistent behaviour. If you overwrite the stack the program has undefined behaviour, it doesn't matter if you did it on purpose or not.