[PATCH 5/5] wined3d: Fix an uninitialised variable warning.

Zhiyi Zhang zzhang at codeweavers.com
Tue May 5 21:19:15 CDT 2020



On 5/6/20 8:30 AM, Chip Davis wrote:
> May 5, 2020 12:29 PM, "Henri Verbeet" <hverbeet at gmail.com> wrote:
>
>> On Tue, 5 May 2020 at 17:17, Zhiyi Zhang <zzhang at codeweavers.com> wrote:
>>
>>> @@ -257,7 +257,7 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info,
>>> G
>>> };
>>>
>>> GLint type, name, samples, width, height, old_texture, level, face, fmt, tex_target;
>>> - const char *tex_type_str;
>>> + const char *tex_type_str = NULL;
>>> unsigned int i;
>>>
>>> gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv(target, attachment,
>>> @@ -310,8 +310,6 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info,
>>> G
>>> }
>>> else
>>> {
>>> - tex_type_str = NULL;
>>> -
>>> for (i = 0; i < ARRAY_SIZE(texture_type); ++i)
>>> {
>>> if (!gl_info->supported[texture_type[i].extension])
>>> --
>> This is fine, but I have to wonder, are you using an unusual compiler
>> or compile flags? The code doesn't seem all that complicated, and at
>> least my version of gcc is able to figure out that the variable is
>> initialised on all paths.
> So is my version of Clang; otherwise, I would've sent something like this myself.
>
>
> Chip
Yeah. I am using -Og.  The warning was a bit distracting so might as well silence it.




More information about the wine-devel mailing list