On Monday, January 5, 2015 11:08:05 PM UTC+2, Scott Lurndal wrote:
> Jorgen Grahn <
grahn...@snipabacken.se> writes:
> >On Mon, 2015-01-05, Scott Lurndal wrote:
> >>
legaliz...@mail.xmission.com (Richard) writes:
> >>>
sl...@pacbell.net spake the secret code
> >>><iWxqw.1082954$Rp.8...@fx23.iad> thusly:
> >...
> >
> >>>>One doesn't always have the choice. Just because a compiler is available
> >>>>doesn't mean that it has been qualified for use in a particular project.
> >>>
> >>>I'm going to disagree and say that you always have a choice, but that
> >>>you have chosen to stick with a C++98 compiler. I know people who
> >>
> >> No, my "boss" requires that I stick with a C++98 compiler. Qualification
> >> of a new compiler is expensive, in terms of man-hours for both testing
> >
> >Do you really perform independent testing of compilers that everyone
> >else has been using for years? If you mean testing for defects in
> >your own code being triggered by the new compiler, aren't you
> >performing testing for other reasons (like actual code changes) and
> >wouldn't those tests be likely to catch those defects?
>
> Before any compiled binary is delivered to a customer/end-user, it
> goes through a battery of tests.
Yes, but "does it compile (without diagnostics)?" is also one of such tests.
That test is usually required from developer to be done before committing
a change to repository. When compiling is expensive (in terms of time and
resources) it can be moved to responsibility of separate automatic build
farm that does it right after commit and reverts the commit on case of
issues.
Why not to wait until we really need a binary for testers? Because
building immediately provides fast feedback to defect's author and so
fixing is cheapest. Other tests that can be organized to provide
fastest feedback are unit tests and static analysis.
Trying to build with other compiler or with different version of same
compiler is just a form of static analysis. It can give false positives
(like any other automatic test) but since it is fast feedback the issues
are cheap to fix and false positives cheap to silence.
> Updating the compiler, sans any other change to an application, triggers
> a full test cycle, which can take months. This has been the case
> regardless of whether the application is an operating system, a
> hypervisor or an application that executes in user mode on a given CPU.
Updating to compiler that has been anyway used as static analysis during
development process is cheaper. Update is usually triggered because the
binaries built with newer compilers tend to show lot better results in
stress tests and in performance tests.
> Third party libraries and ISO 9001 compliance (tracking what version
> of the compiler was used to build every application, for example) also
> come into play.
Certainly there can be reasons why still not to upgrade to newer compiler
for building end-user binaries.
What I argue is that I do not see much reasons for not to take newer
compiler as automatic static analysis tool. Compiler that people have
used for some time (like gcc 4.7 or clang 3.4) can give valuable
hints what is wrong with your code. Clang even comes bundled with some
great tools.