This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC c-common PATCH] PR c++/40752 - useless -Wconversion with short +=.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]