[cfe-dev] How to try out -Wlifetime ?

cen via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 14 11:30:38 PST 2018


Thanks for the tip, I got it up and running.

I am trying -Wlifetime on some decade old projects that were ported from 
C to C++ just to see how bad things are and what are some common 
mistakes. Is it possible to suppress some subset of warnings such as 
-Wlifetime-pointer-arithmetic (it clutters the output way too much and I 
am not interested in this specific warning)? Possibly as a compiler flag 
and not a pragma.


I also managed to segfault clang itself on one project, I guess I should 
report that to the github fork page.


Best regards,

cen


On 11/12/2018 06:08 PM, Jonas Toth wrote:
> Hi,
>
> you can try it out on `godbolt.org`, as there is a custom built there.
>
> If you want to build yourself you should use
> `https://github.com/mgehre/clang` (lifetime-branch) as the patches are
> not upstreamed (yet).
>
> Best, Jonas
>
> Am 12.11.18 um 18:05 schrieb cen via cfe-dev:
>> Hi
>>
>> I watched Herb's talk on Cppcon so I decided to try out the new
>> lifetime feature. I cloned llvm and clang master from github mirror
>> and built both locally.
>>
>> I tried to compile the first godbolt sample
>> (https://godbolt.org/z/szJjnH) but no luck:
>>
>> clang -Wlifetime -lstdc++ b.cpp
>> warning: unknown warning option '-Wlifetime'; did you mean
>> '-Wdate-time'? [-Wunknown-warning-option]
>> 1 warning generated.
>>
>>
>> What am I doing wrong?
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list