Indeed, having your source run on a variety of UNIX platforms is a great way to uncover issues. I regularly have to compile the same code on Solaris, RedHat AS 5, Ubuntu, Debian, HP-UX, HP-UX Itanium & AIX.
The various compilers do have excellent warnings and that's worth exploring as a project, some of them have great 64-bit checking options.
Sun Studio Lint has some wonderful options for diving into your source code to do that extra thorough analysis. It can uncover 64-bit porting problems and something I didn't know, was that it can try to find security problems also.
Example output:
(34) warning: possible ptrdiff_t overflow
(242) warning: format argument to sprintf() contains an unbounded string specifier
(252) warning: format argument to sprintf() contains an unbounded string specifier
(319) warning: possible ptrdiff_t overflow
(324) warning: possible ptrdiff_t overflow
So it can detect the following potential problem :
"Use the -errsecurity option to check your code for security loopholes."
char buffer[80];
sprintf( buffer, sizeof(buffer)-1, "%c%d%d%s%d", ch, i1, i2, filename, i3 );
where it's saying that the filename string isn't limited and could overrun the buffer. One fix would be to change to use "%.*s" rather than "%s".
Sun Studio docs for Lint