And if you're willing to spend a few bucks, pick up a copy of "Secure Programming Cookbook for C and C++" published by O'Reilly. It's one of the most worthwhile books I've ever purchased.
Generally speaking, if writing portable code is a concern, make friends with a build system.
GNU's autoconf is especially popular, as is
CMake
One of these days, somebody ought to document portability issues in detail (at the function/type/etc level) between common UNIX-like systems libc APIs. I'd probably be willing to help with such an effort.