tested with gcc4.8.1