I'm being foolish, forgetting a lesson from Plan 9 style. This will work fine: if (RAMTEST) { ram_test(0, 640*1024); ram_test(whatever); } The compiler will optimize out the whole block if RAMTEST is 0. I think this best. ron