How to try out -Wlifetime ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to try out -Wlifetime ?

Oleg Smolsky 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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to try out -Wlifetime ?

Oleg Smolsky via cfe-dev
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
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to try out -Wlifetime ?

Oleg Smolsky via cfe-dev
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
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev