I presume you’re testing this on Intel. In that case, the result you’re seeing is perfectly reasonable. Intel instructions do not have alignment requirements [1].
I set a breakpoint on the return statement in your code and saw this:
Address of main: 100003f20
Address of printf: 7ff81d13df0b
(lldb) disas -s 7ff81d13df0b
libsystem_c.dylib`printf:
0x7ff81d13df0b <+0>: pushq %rbp
0x7ff81d13df0c <+1>: movq %rsp, %rbp
0x7ff81d13df0f <+4>: subq $0xd0, %rsp
0x7ff81d13df16 <+11>: movq %rdi, %r10
0x7ff81d13df19 <+14>: testb %al, %al
As you can see, printf just happens to start at an odd address [2]. That’s perfectly normal an Intel.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Well, there may be some obscure ones that do — I’m not enough of an expert on that ISA to say for sure one way or the other — so I’m just talking about the standard instructions you use day-to-day.
[2] The specific address is different due to ASLR.