tested on NetBSD 1.6.2-i386 (g++ 2.95.3)