James Molloy's Tutorial Known Bugs: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
m The word 'fine' seems more idiomatic than 'well' in this case.
Line 13: Line 13:
== Problem: __cdecl calling convention ==
== Problem: __cdecl calling convention ==


The tutorial states that the <tt>__cdecl</tt> calling convention is used. This is, however, a Windows term and your cross-compiler uses a similar calling convention but it is called the System V ABI for i386. It is advisable to understand this calling convention in depth, especially parts about how the parameters on the stack are clobbered and how structure parameters are passed. This will be very useful later and will help you avoid a later subtle bug. The function call example in 2.3 neglects to add 12 to esp following the call instruction and the three parameters are never thus popped.
The tutorial states that the <tt>__cdecl</tt> calling convention is used. This is, however, a Windows term. Your cross-compiler uses a similar calling convention but it is called the System V ABI for i386. It is advisable to understand this calling convention in depth, especially parts about how the parameters on the stack are clobbered and how structure parameters are passed. This will be very useful later and will help you avoid a later subtle bug. The function call example in 2.3 neglects to add 12 to esp following the call instruction, so the three parameters are never popped.


== Problem: CFLAGS ==
== Problem: CFLAGS ==