[Mesa-dev] [PATCH 0/3] Fix missing initializer errors in generated tables

Emil Velikov emil.l.velikov at gmail.com
Wed Jun 7 13:38:50 UTC 2017


Hi Chih-Wei,

On 6 June 2017 at 06:16, Chih-Wei Huang <cwhuang at android-x86.org> wrote:

> Making the code warning-free is the responsibility
> of the one who wrote the code instead of
> the one who builds the code.
>
if you look closer you'll see that particular warning will be
triggered at almost any point.
That is using method A will be fine with GCC/Clang version X but Y
will warn and vise-versa. Hence, developers tend to be opinionated
(annoyed really) on the topic.

The only two robust solutions that I know of are
 - designated initalizers
 - memset

Hence why I suggested the former.

> So fix the code, please.
>
Suggestion was provided that fits your and Marek's requirements. Feel
free to pursue ;-)


> 2017-06-05 6:20 GMT+08:00 Emil Velikov <emil.l.velikov at gmail.com>:

>> Keep in might that explicit [zero] initialization may "force" the
>> compiler to generate the actual code, increasing the binary size.
>
> Why should the compiler generate actual code
> in this case? I don't believe the compiler is so silly.
>
IIRC some versions of GCC were doing funny things. Don't recall the
details, thus the "may".
If you're really bored and want to know the details, checking across
versions of GCC and its authors may be a good idea.


-Emil


More information about the mesa-dev mailing list