On Mon, Apr 14, 2014 at 2:41 PM, Yves Mocquard <mocquard.y...@orange.fr> wrote:
> Hello !
> I am French, sorry for my bad english.
>
> When I use gcc or g++ , I like when the compilator detects bug, with a an
> error of compliation or a warning.
>
> see this code :
>
> long long fct()
> {
> return 0x123456789;
> }
> int main()
> {
> int a = fct();
> cerr << a << endl;
> }
>
> when I compil with : g++ -Wall fic.cpp
pass -Wconversion
I got this warning:
fooconv.c:8:14: warning: conversion to 'int' from 'long long int' may
alter its value [-Wconversion]
int a = fct();
^
> I think that there should be a warning.
> And there is nothing, the bug is not detected.
>
> I think that it not normal.
>
> Regards,
>
> Yves Mocquard
>