vrend_formats.c: Silence warning -Wmissing-field-initializers

The warning doesn't really add value, because the way the code is
written the fields will be initialized to zero, hence disable the warning
in this file.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gert Wollny 7 years ago committed by Jakob Bornecrantz
parent 84c74ea082
commit 299c1119d2
  1. 15
      src/vrend_formats.c

@ -32,6 +32,21 @@
#define RRR1_SWIZZLE { PIPE_SWIZZLE_RED, PIPE_SWIZZLE_RED, PIPE_SWIZZLE_RED, PIPE_SWIZZLE_ONE } #define RRR1_SWIZZLE { PIPE_SWIZZLE_RED, PIPE_SWIZZLE_RED, PIPE_SWIZZLE_RED, PIPE_SWIZZLE_ONE }
#define RGB1_SWIZZLE { PIPE_SWIZZLE_RED, PIPE_SWIZZLE_GREEN, PIPE_SWIZZLE_BLUE, PIPE_SWIZZLE_ONE } #define RGB1_SWIZZLE { PIPE_SWIZZLE_RED, PIPE_SWIZZLE_GREEN, PIPE_SWIZZLE_BLUE, PIPE_SWIZZLE_ONE }
#ifdef __GNUC__
/* The warning missing-field-initializers is misleading: If at least one field
* is initialized, then the un-initialized fields will be filled with zero.
* Silencing the warning by manually adding the zeros that the compiler will add
* anyway doesn't improve the code, and initializing the files by using a named
* notation will make it worse, because then he remaining fields truely be
* un-initialized.
*/
#ifdef __clang__
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
#else
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
#endif
/* fill the format table */ /* fill the format table */
static struct vrend_format_table base_rgba_formats[] = static struct vrend_format_table base_rgba_formats[] =
{ {

Loading…
Cancel
Save