d3dx9_36: Silence an uninitialized compiler warning (GCC 8).

Paul Gofman gofmanp at gmail.com
Wed Nov 8 03:33:30 CST 2017


     There is actually no usage of uninitialized variable there, though 
it is probably not exactly straightforward for compiler to guess. Why it 
does not complain that 'cdesc[index]' may be used uninitialized while it 
is handled the same way? AFAIK GCC 8 is not released yet, maybe this 
will change before final release?

     If still to change that, does the attached patch fixes the warning 
as well (sorry, I don't have gcc 8 in hands to test)? If yes, I would 
suggest that would be a tiny bit nicer way to silence the warning.

On 11/07/2017 01:22 AM, Gerald Pfeifer wrote:
> There are more of this in d3dx9_36, but at least this is one down.
>
> Gerald
>
>
> Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
> ---
>   dlls/d3dx9_36/preshader.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dlls/d3dx9_36/preshader.c b/dlls/d3dx9_36/preshader.c
> index e3e91c643b..ed22dc4045 100644
> --- a/dlls/d3dx9_36/preshader.c
> +++ b/dlls/d3dx9_36/preshader.c
> @@ -888,7 +888,7 @@ static HRESULT get_constants_desc(unsigned int *byte_code, struct d3dx_const_tab
>       for (i = 0; i < desc.Constants; ++i)
>       {
>           unsigned int index = out->input_count;
> -        WORD constantinfo_reserved;
> +        WORD constantinfo_reserved = 0;
>   
>           hc = ID3DXConstantTable_GetConstant(ctab, NULL, i);
>           if (!hc)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: constant_info.patch
Type: text/x-patch
Size: 494 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20171108/7c04b060/attachment-0001.bin>


More information about the wine-devel mailing list