[Mesa-dev] [PATCH] gallivm: init MM = NULL to silence warning

Jose Fonseca jfonseca at vmware.com
Wed Mar 4 04:58:41 PST 2015


On 04/03/15 04:20, Matt Turner wrote:
> On Tue, Mar 3, 2015 at 8:07 PM, Brian Paul <brianp at vmware.com> wrote:
>> ---
>>   src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
>> index 5210acc..e2578cf 100644
>> --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
>> +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
>> @@ -493,7 +493,7 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
>>      builder.setMCPU(MCPU);
>>   #endif
>>
>> -   ShaderMemoryManager *MM;
>> +   ShaderMemoryManager *MM = NULL;
>>      if (useMCJIT) {
>>   #if HAVE_LLVM > 0x0303
>>          BaseMemoryManager* JMM = reinterpret_cast<BaseMemoryManager*>(CMM);
>> --
>> 1.9.1
>
> I'm guessing it's the 'delete MM;' that generates the warning? If so,
> shouldn't you just wrap it in #if HAVE_LLVM > ...?
>
> I think MCJIT is the only option in llvm >= 3.6? The code could
> probably be trivially refactored to avoid the assert(0) as well.
>
>  From what I can tell, it seems like adding initializers is nearly
> always the wrong thing to do.
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=eFrgqffTZg-fVfsgBecewE76PU07pVGCehKDjd2rc2Q&s=NmdJuPH44mfwP-iaquREc8ZPTboVxNFpMQhNXlMv2FY&e=
>

Yes, this is probably related to 
https://bugs.freedesktop.org/show_bug.cgi?id=89387

But unfortunately I haven't found time to catch up with it.

Jose


More information about the mesa-dev mailing list