|
From: | Paul Eggert |
Subject: | Re: Preview: portable dumper |
Date: | Fri, 16 Feb 2018 14:31:07 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 02/16/2018 02:02 PM, Daniel Colascione wrote:
I'm not sure what you mean by high quality in this context.
I mean code that is written with reasonable care to check for ranges, much as Emacs normally does. For example, INTEGER_TO_CONS checks for ranges before converting its argument to EMACS_INT. When such code runs afoul of -Wconversion, my experience is that the false alarm rate is so high that -Wconversion causes more trouble than it's worth. I suspect that pdumper.c also had a bunch of false alarms, which is why it contains all that gorp with ALLOW_IMPLICIT_CONVERSION and DISALLOW_IMPLICIT_CONVERSION. I'll try to pry free some time to look in more detail at pdumper.c and see whether there's a way to fix it without worrying so much about -Wconversion.
Which is why I advocate not using -Wconversion: as a rule, -Wconversion takes good code and makes it worse. Of course there are always exceptions, and perhaps pdumper.c is one of those exceptions.if programmers were angels, no warnings would be necessary. The point is to *keep* the code high quality,
[Prev in Thread] | Current Thread | [Next in Thread] |