This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH] -Wmemset-transposed-args (PR middle-end/61294)

> All of these warnings (-Wsizeof-pointer-memaccess, -Wsizeof-array-argument
> and -Wmemset-transposed-args) are implemented in a hackish way, because we
> fold everything too early.  Perhaps for such analysis we want a FOLDED_EXPR
> which would have arguments what it has been folded to and the original tree,
> for the purposes of code generation the first argument would be used and
> the second one only for the analysis.  We don't have that many spots where
> we need the original trees to be analyzed yet for it to be worth it though

But if we keep adding hacks around it, there will never be progress
and the person(s) who take the challenge of properly fixing this will
not only have to deal with the task itself but also with all the ugly
and obscure hacks added year after year.

Is it worth the trouble?

Well, apart from those warnings that you mention, we have several bugs
about it: See PR32643, PR60090.

It prevents other desirable improvements:

It is mentioned as one of the "pros" of Clang vs. GCC:

One of the main reasons why Clang was developed:

One of the reasons why Google switched to Clang:

And there has been a lot of work in this direction in the C FE that
was never translated to the C++ FE:

Unfortunately, this is not the kind of work that a GSOC student or a
volunteer can do on its free time. It requires a lot of experience and
a continuous focused effort.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]