APL\360

wrcooke at wrcooke.net wrcooke at wrcooke.net
Fri Jan 29 15:12:16 CST 2021


> On 01/29/2021 2:58 PM Fred Cisin via cctalk <cctalk at classiccmp.org> wrote:
> 

> '=' and '==' makes possible what is probably the most common error, and
> which the compiler doesn't catch:
> if (x = 3) . . . /* sets x to 3 and gives TRUE for the condition */
> I imagine that there are probably some pre-processors that would return a
> WARNING for it.
> 

Modern Visual Studio and GCC both flag the "=" in a condition, I believe.  But if you're shipping code with 260+ warnings, who would see one more.  

There's a pretty good chance the heat pump you're using right now has those warnings.  Alas...

Will


More information about the cctech mailing list