gcc warning about return value truncation
Liu Hao
lh_mouse@126.com
Sun Dec 29 06:28:00 GMT 2019
在 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20191229/7f76ffe9/attachment-0001.sig>
More information about the Gcc-help
mailing list