Go Ask printf() To Behave Predictably
This is one of those problems whose solution is very evident… or bitterly hard to guess depending on how much you were influenced by what you were told about it.
I’ll paste here the case
I must be getting blind, as I can’t see what’s wrong. This code works on amd64, but crashes on x86.
I debugged a bit and found out that what is failing is actually the first printf, because formatting for %s is not apparently using the address of the string, but it tries to dereference its content.
Can anyone help me see what’s wrong?
You will rapidly solve it… or not! It will actually depend on what it impressed you the most about the symptoms.