Thread overview | ||||||
---|---|---|---|---|---|---|
|
October 10, 2003 BUG ? Conditional expression - string | ||||
---|---|---|---|---|
| ||||
void main() { char[] s1 = false ? "yes" : "no"; printf("s1 = >%.*s<\n",s1); char[] s2 = true ? "yes" : "no"; printf("s2 = >%.*s<\n",s2); char[] s3 = false ? "no" : "yes"; printf("s3 = >%.*s<\n",s3); char[] s4 = true ? "no" : "yes"; printf("s4 = >%.*s<\n",s4); } output: s1 = >no< s2 = >ye< <<<--- expected 'yes' s3 = >yes< s4 = >no< oops? Ant |
October 10, 2003 Re: BUG ? Conditional expression - string | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | Ant wrote: > void main() > { > char[] s1 = false ? "yes" : "no"; > printf("s1 = >%.*s<\n",s1); > > char[] s2 = true ? "yes" : "no"; > printf("s2 = >%.*s<\n",s2); > > char[] s3 = false ? "no" : "yes"; > printf("s3 = >%.*s<\n",s3); > > char[] s4 = true ? "no" : "yes"; > printf("s4 = >%.*s<\n",s4); > > > } > > output: > > s1 = >no< > s2 = >ye< <<<--- expected 'yes' > s3 = >yes< > s4 = >no< > > oops? > > Ant I noticed this same bug back in February: http://www.digitalmars.com/drn-bin/wwwnews?D/11108 Incidently, I think your example is a lot better than mine was. (My code word-wrapped all over the place.) Justin |
October 10, 2003 Re: BUG ? Conditional expression - string | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | This is very scary! Whats the word on what this could be ? C "J C Calvarese" <jcc7@cox.net> wrote in message news:bm7c2t$1pq9$1@digitaldaemon.com... > Ant wrote: > > void main() > > { > > char[] s1 = false ? "yes" : "no"; > > printf("s1 = >%.*s<\n",s1); > > > > char[] s2 = true ? "yes" : "no"; > > printf("s2 = >%.*s<\n",s2); > > > > char[] s3 = false ? "no" : "yes"; > > printf("s3 = >%.*s<\n",s3); > > > > char[] s4 = true ? "no" : "yes"; > > printf("s4 = >%.*s<\n",s4); > > > > > > } > > > > output: > > > > s1 = >no< > > s2 = >ye< <<<--- expected 'yes' > > s3 = >yes< > > s4 = >no< > > > > oops? > > > > Ant > > I noticed this same bug back in February: http://www.digitalmars.com/drn-bin/wwwnews?D/11108 > > Incidently, I think your example is a lot better than mine was. (My code word-wrapped all over the place.) > > Justin > |
October 14, 2003 Re: BUG ? Conditional expression - string | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Sanders | "Charles Sanders" <sanders-consulting@comcast.net> wrote in message news:bm7c9t$1q0c$1@digitaldaemon.com... > This is very scary! Whats the word on what this could be ? It's a bug, and I'm working on fixing it <g>. |
Copyright © 1999-2021 by the D Language Foundation