Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dynamic_alloc: Replace implicit type conversion with incorrect semant…
…ics by proper return value (microsoft#99) The dynamic_alloc example fails to compile on Visual Studio 2015 due to an C4800 / C2220 compiler error (LONG status is used as return value). Apart from the performance warning, which is treated as error because of the /WX flag, the semantics of this operation seem to be wrong. At the end of the function, we find return status == NO_ERROR. That means that in line 70 a successful execution results in a return value of true and an unsuccessful execution results in false. However, if the function is left in line 52, the return code is true (because the test status != NO_ERROR was positive). Fix this, and force /we4800 to be enabled to catch issues in the future. Co-authored-by: Brian Gianforcaro <[email protected]>
- Loading branch information