On 9 April 2010 07:44, Ivo Hanak <hanak@xxxxxxx> wrote: > I tried to search the web but I still do not have any clue why it converts > from double to int by default. This seems pretty dangerous to me. Am I > missing something? Because that is how the C++ standard says it should be and g++ is a C++ compiler so it (aims to) implement the C++ standard. You can use -Wconversion to get a warning and -Werror=conversion to get an error for that line. You should also read about -Wall, -Wextra and -Werror in the documentation. Cheers, Manuel.