Type safety could prevent nuclear war

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 4 16:56:16 PST 2016


On Fri, 05 Feb 2016 00:38:16 +0000, tsbockman wrote:

> On Friday, 5 February 2016 at 00:03:56 UTC, Chris Wright wrote:
>> Doing this sort of validation requires build system integration (track
>> the command line arguments that went into producing this object file;
>> find which object files are combined into which targets; run the
>> analysis on that) and costs as much time as compiling the whole project
>> from scratch.
> 
> There is no need to take "as much time as compiling the whole project
> from scratch".
> 
> The necessary information is already gathered during the normal course
> of compilation; all that is required is to actually save it somewhere
> until link-time, instead of throwing it away.

True. That works if this is baked into your compiler, or if your compiler 
has plugin support. And you'd have to compile with this plugin or the 
relevant options turned on by default in order for you not to duplicate 
work.

That's partly an engineering issue (build this thing in this particular 
way) and partly a social issue (get people to run it by default; have 
them add the extra flag to the makefile to specify to create the relevant 
output; possibly get your compiler vendor to build it in, depending on 
what compiler your devs are using).

I imagine Google, to take a random example where I have experience, would 
add this as a presubmit step rather than requiring it on every build.


More information about the Digitalmars-d mailing list