This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC c-common PATCH] PR c++/40752 - useless -Wconversion with short +=.
- From: Martin Liška <mliska at suse dot cz>
- To: Jason Merrill <jason at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Manuel López-Ibáñez <manu at gcc dot gnu dot org>
- Date: Wed, 22 Jan 2020 11:14:19 +0100
- Subject: Re: [RFC c-common PATCH] PR c++/40752 - useless -Wconversion with short +=.
- References: <7811f8e0-0e03-4e68-dcbd-c07dccfa9f3c@redhat.com>
Hi.
Just for the record, after the change 526.blender_r fails due to:
blender/source/blender/blenlib/intern/math_color.c: In function 'rgb_float_to_uchar':
blender/source/blender/blenlib/BLI_utildefines.h:251:22: error: conversion from 'float' to 'unsigned char' may change value [-Werror=float-conversion]
251 | #define FTOCHAR(val) ((CHECK_TYPE_INLINE(val, float)), \
| ^
blender/source/blender/blenlib/BLI_utildefines.h:257:13: note: in expansion of macro 'FTOCHAR'
257 | (v1)[0] = FTOCHAR((v2[0])); \
| ^~~~~~~
blender/source/blender/blenlib/intern/math_color.c:421:2: note: in expansion of macro 'F3TOCHAR3'
421 | F3TOCHAR3(col_f, r_col);
| ^~~~~~~~~
where the project sets -Werror=float-conversion dues to:
$ cat blender/source/blender/blenlib/BLI_strict_flags.h
#ifdef __GNUC__
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 /* gcc4.6+ only */
# pragma GCC diagnostic error "-Wsign-compare"
# pragma GCC diagnostic error "-Wconversion"
# endif
Martin