Date: Thu, 10 Apr 2025 17:16:32 +0200
Of course it's true that Debug and Release builds always differ and both
should be tested. However I would be extremely surprised that the compiler
is actively compiling different code based on Debug and Release builds, to
such an extent that my code in Debug and Release is simply not the same and
has different effects (e.g. in Debug value A gets moved last, in Release
value B gets moved last).
I don't think that's an acceptable standard to have.
Op do 10 apr 2025 om 15:19 schreef Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]>:
> On Thu, Apr 10, 2025 at 2:06 PM Bo Persson via Std-Proposals wrote:
> >
> > This is a very big deal where I come from. Having code do different
> > things in test and production environments is a big no-no. What have we
> > tested?!
>
>
> Anyone who's been programming in C++ for more than a year or two has
> come across a few strange situations, such as:
>
> Scenario 1) Program malfunctions in Debug mode, but runs fine in
> Release mode
> Scenario 2) Program runs fine in Debug mode, and malfunctions in
> Release mode
>
> To answer your question Bo, you asked "What have we tested?!", well
> the answer is as follows:
> "If you tested the Debug mode build, then you tested the Debug
> mode build. If you tested the Release mode build, then you tested the
> Release mode build."
>
> Typically here's how I operate when I write a new program:
> Step 1 - Test the Debug mode binary on my dev laptop (x86_64)
> Step 2 - Test the Debug mode binary on 27 cross-compilers with Qemu
> Step 3 - Test the Release mode binary on my dev laptop (x86_64)
> Step 4 - Test the Release mode binary on 27 cross-compilers with Qemu
>
> If the Debug mode binary and also the Release mode binary run fine on
> two dozen different architectures (big endian, little endian, 32-bit
> pointers, 64-bit pointers, stack grows up, stack grows down), then I'm
> on to a winner.
>
> But there will always be a caveat in all of this: Just because the
> Debug mode binary runs fine, doesn't mean the Release mode binary will
> run fine. And vice versa.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
should be tested. However I would be extremely surprised that the compiler
is actively compiling different code based on Debug and Release builds, to
such an extent that my code in Debug and Release is simply not the same and
has different effects (e.g. in Debug value A gets moved last, in Release
value B gets moved last).
I don't think that's an acceptable standard to have.
Op do 10 apr 2025 om 15:19 schreef Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]>:
> On Thu, Apr 10, 2025 at 2:06 PM Bo Persson via Std-Proposals wrote:
> >
> > This is a very big deal where I come from. Having code do different
> > things in test and production environments is a big no-no. What have we
> > tested?!
>
>
> Anyone who's been programming in C++ for more than a year or two has
> come across a few strange situations, such as:
>
> Scenario 1) Program malfunctions in Debug mode, but runs fine in
> Release mode
> Scenario 2) Program runs fine in Debug mode, and malfunctions in
> Release mode
>
> To answer your question Bo, you asked "What have we tested?!", well
> the answer is as follows:
> "If you tested the Debug mode build, then you tested the Debug
> mode build. If you tested the Release mode build, then you tested the
> Release mode build."
>
> Typically here's how I operate when I write a new program:
> Step 1 - Test the Debug mode binary on my dev laptop (x86_64)
> Step 2 - Test the Debug mode binary on 27 cross-compilers with Qemu
> Step 3 - Test the Release mode binary on my dev laptop (x86_64)
> Step 4 - Test the Release mode binary on 27 cross-compilers with Qemu
>
> If the Debug mode binary and also the Release mode binary run fine on
> two dozen different architectures (big endian, little endian, 32-bit
> pointers, 64-bit pointers, stack grows up, stack grows down), then I'm
> on to a winner.
>
> But there will always be a caveat in all of this: Just because the
> Debug mode binary runs fine, doesn't mean the Release mode binary will
> run fine. And vice versa.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
-- Rhidian De Wit Software Engineer - Barco
Received on 2025-04-10 15:16:45