After reading that document, the first thing you should do is compile your code with the -Wall compiler flag and fix any warnings that occur.
Make sure that all function prototypes are in scope, because out-of-scope prototypes can hide many subtle portability problems.