c++ - [BUG] reversed subscript operator still not supported in C
- Matthew (3/3) Mar 26 2004 char ch;
- Ilya Minkov (7/12) Mar 26 2004 Oh, come on, do you really need it? I'm pretty much sure that this was
- Matthew (4/16) Mar 26 2004 I have not idea what point you're making. The compiler has non-standard
- Jan Knepper (6/8) Mar 26 2004 --
- Matthew (1/9) Mar 26 2004
- gf (6/19) Mar 26 2004 I guess it was sarcasm about DMC's non-standard behaviour.
- Will Dean (7/10) Mar 26 2004 And Walter has said that he's not working on some of the crashing bugs a...
- Matthew (8/19) Mar 26 2004 this.
- Jan Knepper (9/13) Mar 26 2004 Walter probably will fix it sometime.
- Matthew (15/34) Mar 26 2004 All the other Win32 compilers - Borland, Comeau, CodePlay, CodeWarrior, ...
- Ilya Minkov (10/23) Mar 27 2004 Ah, you actually have some use for that! Interesting. Ok, this actually
- gf (12/40) Mar 27 2004 Nope, it's a standard! :)
Matthew schrieb:char ch; char *p = &ch; 0[p] = 'a';Oh, come on, do you really need it? I'm pretty much sure that this was Walter's conscious desision to disallow that, so pointing his nose into standard or just popping up from time to time would give you nothing. It seems that C standard defines subscript as addition, but Walter has made additional (!) effort to actually do a subscript out of it! -eye
Mar 26 2004
I have not idea what point you're making. The compiler has non-standard behaviour. What more needs to be said? "Ilya Minkov" <minkov cs.tum.edu> wrote in message news:c418p9$1uaf$1 digitaldaemon.com...Matthew schrieb:char ch; char *p = &ch; 0[p] = 'a';Oh, come on, do you really need it? I'm pretty much sure that this was Walter's conscious desision to disallow that, so pointing his nose into standard or just popping up from time to time would give you nothing. It seems that C standard defines subscript as addition, but Walter has made additional (!) effort to actually do a subscript out of it! -eye
Mar 26 2004
Have you talked to Microsoft or Borland lately? Matthew wrote:I have not idea what point you're making. The compiler has non-standard behaviour. What more needs to be said?-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 26 2004
About what?Have you talked to Microsoft or Borland lately? Matthew wrote:I have not idea what point you're making. The compiler has non-standard behaviour. What more needs to be said?-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 26 2004
"Matthew" <matthew stlsoft.org> wrote in news:c41j5r$2fmp$1 digitaldaemon.com:About what?I guess it was sarcasm about DMC's non-standard behaviour. I agree with you, Matthew, this is non-standard - I've seen it writen in C++ : The Core Language - and, as far as I know, VC and BCC do allow this.~/gnf.ptHave you talked to Microsoft or Borland lately? Matthew wrote:I have not idea what point you're making. The compiler has non-standard behaviour. What more needs to be said?-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 26 2004
"gf" <mz_y2k yahoo...com> wrote in message news:Xns94B8E2E9992CDmzy2kyahoocom 63.105.9.61...I guess it was sarcasm about DMC's non-standard behaviour. I agree with you, Matthew, this is non-standard - I've seen it writen in C++ : The Core Language - and, as far as I know, VC and BCC do allow this.And Walter has said that he's not working on some of the crashing bugs at the moment because he wants to get the standards compliance right first. So I expect he's more pleased to receive info about compliance bugs than he would be to get it about crashes... Will
Mar 26 2004
"Will Dean" <will nospam.demon.co.uk> wrote in message news:c42c37$oah$1 digitaldaemon.com..."gf" <mz_y2k yahoo...com> wrote in message news:Xns94B8E2E9992CDmzy2kyahoocom 63.105.9.61...this.I guess it was sarcasm about DMC's non-standard behaviour. I agree with you, Matthew, this is non-standard - I've seen it writen in C++ : The Core Language - and, as far as I know, VC and BCC do allowAnd Walter has said that he's not working on some of the crashing bugs at the moment because he wants to get the standards compliance right first. So I expect he's more pleased to receive info about compliance bugs thanhewould be to get it about crashes... WillAh, I understand the sarcasm now. Doh! It was "Borland and Microsoft have lots of non-standard behaviour, so why should Digital Mars care?". Well, I see no virtue in that position, and I would guess Walter doesn't either.
Mar 26 2004
Matthew wrote:Ah, I understand the sarcasm now. Doh! It was "Borland and Microsoft have lots of non-standard behaviour, so why should Digital Mars care?".Oh...Well, I see no virtue in that position, and I would guess Walter doesn't either.Walter probably will fix it sometime. You probably can fix it with a C-style cast too... -- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 26 2004
All the other Win32 compilers - Borland, Comeau, CodePlay, CodeWarrior, GCC, Intel, MSVC, Watcom - work correctly in this regard. The reason it's come up again is because I was expanding the compatibility of the recls test programs to as many compilers as possible, and one of the C clients uses my NUM_ELEMENTS macro, which uses the reversed subscript form. <pretty-shameless-plug>The reasons for doing so are to be found in Chapter 2 of "Imperfect C++", which should be out in Sept/Oct</pretty-shameless-plug> IMO, if something is non-standard, then that looks (and is) bad, no matter how esoteric. The fact that it must be ridiculously simple to fix - since this works for C++, it must be - then I cannot see any good reason why the non-conformance would be dealt-with (Walter's ridiculous workload notwithstanding, of course). "gf" <mz_y2k yahoo...com> wrote in message news:Xns94B8E2E9992CDmzy2kyahoocom 63.105.9.61..."Matthew" <matthew stlsoft.org> wrote in news:c41j5r$2fmp$1 digitaldaemon.com:About what?I guess it was sarcasm about DMC's non-standard behaviour. I agree with you, Matthew, this is non-standard - I've seen it writen in C++ : The Core Language - and, as far as I know, VC and BCC do allow this.~/gnf.ptHave you talked to Microsoft or Borland lately? Matthew wrote:I have not idea what point you're making. The compiler has non-standard behaviour. What more needs to be said?-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 26 2004
Matthew schrieb:All the other Win32 compilers - Borland, Comeau, CodePlay, CodeWarrior, GCC, Intel, MSVC, Watcom - work correctly in this regard.Not an argument.The reason it's come up again is because I was expanding the compatibility of the recls test programs to as many compilers as possible, and one of the C clients uses my NUM_ELEMENTS macro, which uses the reversed subscript form. <pretty-shameless-plug>The reasons for doing so are to be found in Chapter 2 of "Imperfect C++", which should be out in Sept/Oct</pretty-shameless-plug>Ah, you actually have some use for that! Interesting. Ok, this actually justifies it, although i cannot really imagine it too well. Say, does a simple addition not come into consideration? a[b] should standardly be the same as a+b, so that if one of them is a pointer, and another is an integer - no matter which - it works the same as pointer subscript if parenthesized correctly.IMO, if something is non-standard, then that looks (and is) bad, no matter how esoteric. The fact that it must be ridiculously simple to fix - since this works for C++, it must be - then I cannot see any good reason why the non-conformance would be dealt-with (Walter's ridiculous workload notwithstanding, of course).Ah, it already works in C++? Then one of the behaviours is a bug. ;) -eye
Mar 27 2004
Ilya Minkov <minkov cs.tum.edu> wrote in news:c43rh3$rh$1 digitaldaemon.com:Matthew schrieb:Nope, it's a standard! :)All the other Win32 compilers - Borland, Comeau, CodePlay, CodeWarrior, GCC, Intel, MSVC, Watcom - work correctly in this regard.Not an argument.As they say in "C++: Core language" (where I saw this for the first time) "The array support provided by the language is mostly just convenient memory management and pointer arithmetic. Perhaps the best evidence is that brackets operator is, surprisingly, commutative. That is, if 'a' is an array, a[5] and 5[a] are interchangeable. The brackets are just a shorthand for pointer arithmetic: a[5] = *(a+5) = *(5+a) = 5[a]."The reason it's come up again is because I was expanding the compatibility of the recls test programs to as many compilers as possible, and one of the C clients uses my NUM_ELEMENTS macro, which uses the reversed subscript form. <pretty-shameless-plug>The reasons for doing so are to be found in Chapter 2 of "Imperfect C++", which should be out in Sept/Oct</pretty-shameless-plug>Ah, you actually have some use for that! Interesting. Ok, this actually justifies it, although i cannot really imagine it too well. Say, does a simple addition not come into consideration? a[b] should standardly be the same as a+b, so that if one of them is a pointer, and another is an integer - no matter which - it works the same as pointer subscript if parenthesized correctly.~/gnf.ptIMO, if something is non-standard, then that looks (and is) bad, no matter how esoteric. The fact that it must be ridiculously simple to fix - since this works for C++, it must be - then I cannot see any good reason why the non-conformance would be dealt-with (Walter's ridiculous workload notwithstanding, of course).Ah, it already works in C++? Then one of the behaviours is a bug. ;) -eye
Mar 27 2004