[llvmlinux] FW: The uninitialized_var() macro is gcc dependent

Mark Charlebois charlebm at gmail.com
Wed Sep 12 21:35:08 UTC 2012


> ________________________________________
> From: llvmlinux-bounces at lists.linuxfoundation.org [llvmlinux-bounces at lists.linuxfoundation.org] on behalf of Manuel Schölling [manuel.schoelling at gmx.de]
> Sent: Tuesday, September 11, 2012 1:07 PM
> To: llvmlinux at lists.linuxfoundation.org
> Subject: [llvmlinux] The uninitialized_var() macro is gcc dependent
>
> Hi,
>
> just a small hint: you can trick the uninitialized warning of clang using this macro:
>
> #define uninitialized_var(x) x = *(&x)
>
> instead of the gcc version of this macro:
> #define uninitialized_var(x) x = x
>
> Cheers,
>
> Manuel
>

Thanks Manuel! Very helpful! I will update the patch accordingly.

>
> _______________________________________________
> LLVMLinux mailing list
> LLVMLinux at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux



More information about the LLVMLinux mailing list