gcc warning about return value truncation

Yubin Ruan ablacktshirt@gmail.com
Thu Jan 2 05:37:00 GMT 2020


Thanks a lot.

On Sun, Dec 29, 2019 at 2:29 PM Liu Hao <lh_mouse@126.com> wrote:
>
> 在 2019/12/29 13:11, Yubin Ruan 写道:
> > Is there any gcc flag to warn about this?
> >
> >
> > The return value of func() was truncated because the return type is
> > accidentally written as int16_t
> >
>
>
> It's `-Wconversion`. By the way I suggest you add `-Wsign-conversion` in
> C++ as well.
>
>
> --
> Best regards,
> LH_Mouse
>



More information about the Gcc-help mailing list