Thoughts on some code breakage with 2.074

Ali Çehreli via Digitalmars-d digitalmars-d at puremagic.com
Wed May 10 05:05:59 PDT 2017


On 05/09/2017 10:34 AM, H. S. Teoh via Digitalmars-d wrote:

 > I even appreciate breakages that eventually force me to write more
 > readable code!  A not-so-recent example:
 >
 > 	/* Used to work, oh, I forget which version now, but it used to
 > 	 * work: */
 > 	MyType* ptr = ...;
 > 	if (someCondition && ptr) { ... }
 >
 > After upgrading the compiler, I get a warning that using a pointer as a
 > condition is deprecated.  At first I was mildly annoyed... but then to
 > make the warning go away, I wrote this instead:
 >
 > 	/* Look, ma! Self-documenting, readable code! */
 > 	MyType* ptr = ...;
 > 	if (someCondition && ptr !is null) { ... }

Can you show an example please. I don't see this being required by 
2.074.0 (compiled with -w -de).

Thank you,
Ali



More information about the Digitalmars-d mailing list