digitalmars.D.bugs - (a) & b parsed as cast expr!
- bug d.com (10/10) Jan 12 2005 ======================================== op.d ===
- Stewart Gordon (8/20) Jan 13 2005 Been mentioned a few times. It's just a limitation of context-free
- Walter (5/21) Jan 15 2005 True. I should also point out that while putting pointless parentheses
- bug d.com (4/26) Jan 15 2005 The code actually is generated by a tool :-)
- Walter (5/11) Jan 19 2005 I hadn't thought of that. You can make it work by adding a unary +, as i...
- Ivan Senji (10/22) Jan 22 2005 expansions),
-
Stewart Gordon
(9/12)
Jan 24 2005
- Ivan Senji (17/29) Jan 24 2005 I don't! But maybe you didn't understand me (and i can't blame you becau...
- Stewart Gordon (7/10) Jan 24 2005 Would you care to be specific? What new bugs would it cause?
- Ivan Senji (6/16) Jan 24 2005 I didn't say would, i said could. You can never know what problems remov...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (9/16) Jan 16 2005 Some people put extra parenthesis to make later maintenance easier,
- bug d.com (8/24) Jan 16 2005 No one mentioned that the tool is a dedicated C tool.
======================================== op.d === int main(char[][] args) { int a, b, c; c = (a) & b; // a & b works, b & (a) works return 0; } ======================================== op.d === $ dmd op.d op.d(5): C style cast deprecated, use cast(a)(#b)
Jan 12 2005
bug d.com wrote:======================================== op.d === int main(char[][] args) { int a, b, c; c = (a) & b; // a & b works, b & (a) works return 0; } ======================================== op.d === $ dmd op.d op.d(5): C style cast deprecated, use cast(a)(#b)Been mentioned a few times. It's just a limitation of context-free parsing coupled with a grammar that isn't quite made for it. Once C-style casts finally get removed from the language, it'll work. Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Jan 13 2005
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:cs60b2$2j0o$1 digitaldaemon.com...bug d.com wrote:True. I should also point out that while putting pointless parentheses around expressions is common in C (because of macro argument expansions), they are unnecessary in D, so this bug shouldn't cause significant problems.======================================== op.d === int main(char[][] args) { int a, b, c; c = (a) & b; // a & b works, b & (a) works return 0; } ======================================== op.d === $ dmd op.d op.d(5): C style cast deprecated, use cast(a)(#b)Been mentioned a few times. It's just a limitation of context-free parsing coupled with a grammar that isn't quite made for it. Once C-style casts finally get removed from the language, it'll work.
Jan 15 2005
In article <cscvki$10av$1 digitaldaemon.com>, Walter says..."Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:cs60b2$2j0o$1 digitaldaemon.com...The code actually is generated by a tool :-) D compiler should be friendly with code-generation tools, to make D more popular.bug d.com wrote:True. I should also point out that while putting pointless parentheses around expressions is common in C (because of macro argument expansions), they are unnecessary in D, so this bug shouldn't cause significant problems.======================================== op.d === int main(char[][] args) { int a, b, c; c = (a) & b; // a & b works, b & (a) works return 0; } ======================================== op.d === $ dmd op.d op.d(5): C style cast deprecated, use cast(a)(#b)Been mentioned a few times. It's just a limitation of context-free parsing coupled with a grammar that isn't quite made for it. Once C-style casts finally get removed from the language, it'll work.
Jan 15 2005
<bug d.com> wrote in message news:csd25m$12f6$1 digitaldaemon.com...problems.True. I should also point out that while putting pointless parentheses around expressions is common in C (because of macro argument expansions), they are unnecessary in D, so this bug shouldn't cause significantThe code actually is generated by a tool :-)I hadn't thought of that. You can make it work by adding a unary +, as in (+p).D compiler should be friendly with code-generation tools, to make D more popular.I agree.
Jan 19 2005
"Walter" <newshound digitalmars.com> wrote in message news:csn5bj$157d$3 digitaldaemon.com...<bug d.com> wrote in message news:csd25m$12f6$1 digitaldaemon.com...expansions),True. I should also point out that while putting pointless parentheses around expressions is common in C (because of macro argumentThat is a great idea, my tool also generates a code that looks like this and this will fix it. :) But i hope that removing c-style casts will fix this? It would be better to remove c-cast code sooner to have more time to fix bugs that might be caused by removing it.problems.they are unnecessary in D, so this bug shouldn't cause significantThe code actually is generated by a tool :-)I hadn't thought of that. You can make it work by adding a unary +, as in (+p).D compiler should be friendly with code-generation tools, to make D more popular.I agree.
Jan 22 2005
Ivan Senji wrote: <snip>But i hope that removing c-style casts will fix this? It would be better to remove c-cast code sooner to have more time to fix bugs that might be caused by removing it.<snip> Really? Do that many people compile in deprecated mode for everyday purposes? Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Jan 24 2005
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:ct2mrm$qoq$1 digitaldaemon.com...Ivan Senji wrote: <snip>I don't! But maybe you didn't understand me (and i can't blame you because of my English): I wanted to write: In the compiler there is code that parses c-casts and causes wrong messages about c cast when what you are trying to do has nothing to do with casting. Like in: int abc,def; def = (abc) + 2; Now it will probbably be fixed by removing c-casts code, and enable the above code to be parsed as an assignement, but removing that code could also result in new bugs. And we don't need them :)But i hope that removing c-style casts will fix this? It would be better to remove c-cast code sooner to have more time to fix bugs that might be caused by removing it.<snip> Really? Do that many people compile in deprecated mode for everyday purposes?Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Jan 24 2005
Ivan Senji wrote: <snip>Now it will probbably be fixed by removing c-casts code, and enable the above code to be parsed as an assignement, but removing that code could also result in new bugs. And we don't need them :)Would you care to be specific? What new bugs would it cause? Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Jan 24 2005
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:ct35a9$1e2r$1 digitaldaemon.com...Ivan Senji wrote: <snip>I didn't say would, i said could. You can never know what problems removing or adding code can cause. So i can't be specific, just a precaution, if any bugs come it is better to be sooner :-)Now it will probbably be fixed by removing c-casts code, and enable the above code to be parsed as an assignement, but removing that code could also result in new bugs. And we don't need them :)Would you care to be specific? What new bugs would it cause?Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Jan 24 2005
Walter wrote:Some people put extra parenthesis to make later maintenance easier, just as they put extra braces on the if and else statement blocks... But that's really besides the point. D is not source-compatible with C, so the code-generator tool mentioned just seems to be broken... :-) If there is a more complex generator than the "a,b,c" example lurking behind-the-scenes, it would be interesting to see some real code... Otherwise, just drop the parens. Just like with functions: (void) => () --andersBeen mentioned a few times. It's just a limitation of context-free parsing coupled with a grammar that isn't quite made for it. Once C-style casts finally get removed from the language, it'll work.True. I should also point out that while putting pointless parentheses around expressions is common in C (because of macro argument expansions), they are unnecessary in D, so this bug shouldn't cause significant problems.
Jan 16 2005
In article <csdv2i$1vhh$1 digitaldaemon.com>, =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...Walter wrote:No one mentioned that the tool is a dedicated C tool. There's only one question here: puting extra parenthesis around 'a' is valid D syntax or not. If it is, then the DMD compiler should be fixed. Otherwise, the tool should be fixed. Make simple things simple.Some people put extra parenthesis to make later maintenance easier, just as they put extra braces on the if and else statement blocks... But that's really besides the point. D is not source-compatible with C, so the code-generator tool mentioned just seems to be broken... :-)Been mentioned a few times. It's just a limitation of context-free parsing coupled with a grammar that isn't quite made for it. Once C-style casts finally get removed from the language, it'll work.True. I should also point out that while putting pointless parentheses around expressions is common in C (because of macro argument expansions), they are unnecessary in D, so this bug shouldn't cause significant problems.If there is a more complex generator than the "a,b,c" example lurking behind-the-scenes, it would be interesting to see some real code... Otherwise, just drop the parens. Just like with functions: (void) => () --anders
Jan 16 2005