[PATCH] D99825: [cmake] Enable -Werror=return-type for clang

Dave Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 6 14:42:48 PDT 2021


kastiglione added a comment.

> Generally we try pretty hard to be -Werror clean for clang at least (& some folks do so for gcc too)

With this kind of change, it's one less place to _try_, the compiler would enforce it.

> The two I see are `date-time` and `unguarded-availability-new`

There's also `non-virtual-dtor` and `suggest-override`.

> I'd rather not get into the territory of classifying different warnings - and encourage people to turn on -Werror generally, as many buildbots do

I agree it would be good if `-Werror` were used pretty much everywhere. But with it not being used everywhere, downstream projects have warnings and can't flip the switch. A change like this is a small incremental improvement that prevents a certain kind of error at compile time, like the other `-Werror=...` flags. I think there's an argument to be made that this warning is more severe than some of the others marked as errors. And again some projects in llvm already turn it on, so there is evidence supporting it as a good thing.

Unfortunately I don't know what you mean by "I'd rather not get into the territory". Will this have a cost to you? Or do you mean you wish to preemptively prevent debates about which warnings should/shouldn't be errors?

Did you have any comments on @xbolva00's comments? I thought those were pretty compelling.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99825/new/

https://reviews.llvm.org/D99825



More information about the llvm-commits mailing list