Re: Conversion from double to int by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux