On 2016/08/25 6:38, Mike Hommey wrote:
On Mon, Aug 22, 2016 at 04:39:15PM -0700, R Kent James wrote:
On 8/21/2016 9:14 PM, Nicholas Nethercote wrote:
I strongly encourage people to do likewise on
any IDL files with which they are familiar. Adding appropriate checks isn't
always easy

Exactly, and I hope that you and others restrain your exuberance a
little bit for this reason. A warning would be one thing, but a hard
failure that forces developers to drop what they are doing and think
hard about an appropriate check is just having you set YOUR priorities
for people rather than letting people do what might be much more
important work.

If you feel so strongly that you don't want to spend your time chasing
those new errors as they pop up, you're also free to drop what you are
doing and add -Wno-error=unused-result to your build flags.

Mike

But that means we have to add -Wno-error=unused-result to compiler flag that produces the released binary in the server farm. Correct?
(At least this would be the case of C-C TB a couple of days ago...)

In the long run, I would DFINITELY like to see this type of compile-time warning (maybe not the compiler failure) so that we can fix the non-checking of should-be-checked return value of low primitives. There are simply TOO MANY such omission of checks in C-C and M-C code to my taste. I was disgusted to read the code (and still am) to read C-C code to fix a minor bug (and that is not limited to C++ code, but to JS code either), and lo and behold, when I trace the return value processing, I often end up seeing that M-C code also fails to do the proper checking of return value. (It is a problem of legacy code without such built-in checks at the early stage.)

I have tried to add such checks in many places when I produced the patch to enable buffering for file I/O (mostly output) in C-C TB. Without such checks, the supposed transaction processing of e-mail messages in the face of download/saving failure of the message does not work, and I have found out there are places where proper error checking that should have been there in the face of network file system failures due to networking issues.

I have said this several times before, but if the code in mozilla source tree is handed in as a course project to a systems programming 401 or something like that, I would have no qualm to give D to the submitter as the TA or lecturer.

There ought to be a long-term plan for C-C and M-C to introduce such missing checks gradually.

Just two my cents worth.

CI

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to