- I think references should have been const by default - 10 Updates
- Global const objects missing from object file - 3 Updates
- Tricky ... - 1 Update
| Juha Nieminen <nospam@thanks.invalid>: Oct 29 04:47AM >>And which part of "an array and a pointer are different things" do you not >>understand? > Ok, you're either just plain thick or you're trolling now. I'll take that as a concession. You know you are wrong and have no response. |
| Juha Nieminen <nospam@thanks.invalid>: Oct 29 04:51AM >>> int a[2][3]; >>Contrast that to what sizeof(a) will be here. > FFS man, do you even understand whats being discussed here? Yes. You claim that in func(int a[2][3]) that 'a' there is declaring an array. According to you, it's declaring an array, and it doesn't matter what's happening "under the hood". If that were the case, if 'a' there were indeed an array, then it would behave like an array, and be the size of an array, just like that 'a' in the main() function. Yet, it doesn't. It actually behaves exactly like a pointer, not an array. Its size is that of a pointer, and its type is that of a pointer, and the declaration is exactly that of a pointer, at the language syntax level. The fact that you refuse to even answer my question, ie. what sizeof(a) is in those two cases, is telling. |
| Juha Nieminen <nospam@thanks.invalid>: Oct 29 05:11AM >>And which part of "an array and a pointer are different things" do you not >>understand? > Ok, you're either just plain thick or you're trolling now. Btw, I would warmly recommend that you do some self reflection. Ask yourself: *Why* are you just dodging the questions presented to you, and instead just throwing accusations and belittlement instead? If you were right, you wouldn't have to, and instead you could present arguments to what's actually said to you. Instead, you just dodge and throw insults. I think you know that you messed up, and now just stubborningly refuse to acknowledge it, or even to simply stop. Ask yourself why that's so, and whether that's actually something you really want to do. (Of course you will not do any of that. At least not right now. I'm just hoping that at some point in the future you'll start doing so.) |
| JohnnyCameLater@whatsthetime.net: Oct 29 08:39AM On Fri, 29 Oct 2021 04:51:57 -0000 (UTC) >Yes. You claim that in func(int a[2][3]) that 'a' there is >declaring an array. According to you, it's declaring an array, >and it doesn't matter what's happening "under the hood". Do you understand the different stages of compilation? Have you heard of lexical analysis vs parsing vs code generation? I'm guessing not. >If that were the case, if 'a' there were indeed an array, then >it would behave like an array, and be the size of an array, >just like that 'a' in the main() function. Honestly, I just give up. Its amusing how you see yourself as some kind of expert :) >The fact that you refuse to even answer my question, ie. >what sizeof(a) is in those two cases, is telling. I already answered it. Yes, it'll be the size of a pointer because BY THAT POINT it'll be treated as a pointer. |
| JohnnyCameLater@whatsthetime.net: Oct 29 08:40AM On Fri, 29 Oct 2021 05:11:53 -0000 (UTC) >>>understand? >> Ok, you're either just plain thick or you're trolling now. >Btw, I would warmly recommend that you do some self reflection. Says Mr Depressive Aspie. Irony, much? |
| Tim Rentsch <tr.17687@z991.linuxsc.com>: Oct 29 06:32AM -0700 > If gcc (or whichever compiler this is) doesn't give an outright error from > trying to assign a const pointer to a non-const one without an explicit > cast, then it's non-standard-conforming [...] I belive that statement is not correct. Can you cite a passage (or passages) in the C++ standard that supports this assertion? |
| Tim Rentsch <tr.17687@z991.linuxsc.com>: Oct 29 06:34AM -0700 > There's literally zero reason not to use 'const' for pointers that > are not intended to be used to modify the values they are pointing to. There is literally zero chance that this statement is not hyperbole. |
| Tim Rentsch <tr.17687@z991.linuxsc.com>: Oct 29 06:41AM -0700 > "nonportable" or "erroneous" /and/ is not covered by this > standard's requirements>> > [...] Thank you for injecting a note of sanity into a discussion of what text in the C and C++ standards means. |
| Tim Rentsch <tr.17687@z991.linuxsc.com>: Oct 29 06:45AM -0700 >>> it better than others. >> Says the preening fool. > James is not a "preening fool". He's right. To be fair, sometimes he is one, and sometimes the other. |
| Keith Thompson <Keith.S.Thompson+u@gmail.com>: Oct 29 11:11AM -0700 >>> Says the preening fool. >> James is not a "preening fool". He's right. > To be fair, sometimes he is one, and sometimes the other. To be fair, Tim, shut up. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips void Void(void) { Void(); } /* The recursive call of the void */ |
| Tim Rentsch <tr.17687@z991.linuxsc.com>: Oct 29 06:29AM -0700 > primarily meant for replacing C #define. Each C #define is TU-specific > and gets fully preprocessed by the preprocessor, no other TU-s are > involved. It appears you have sidestepped the central question here. What a definition like 'const int foo = 7;' (without any mention anywhere of 'extern') does in C++ is, AFAICT, exactly the same as a similar definition with static, namely 'static const int foo = 7;'. If these two definitions are exactly the same (and I believe they are), why change the meaning of the version that doesn't say 'static'? Why introduce what appears to be a gratuitous incompatibility with C when there was already a perfectly good construct that could be used (and works in C++ now) for defining a local constant? |
| Bo Persson <bo@bo-persson.se>: Oct 29 03:55PM +0200 On 2021-10-29 at 15:29, Tim Rentsch wrote: > Why introduce what appears to be a gratuitous incompatibility with C > when there was already a perfectly good construct that could be used > (and works in C++ now) for defining a local constant? A problem here is that C++ introduced the const keyword first. When C got it later, the C committee decided to do it slighly differently. Now what? |
| scott@slp53.sl.home (Scott Lurndal): Oct 29 02:44PM >definition like 'const int foo = 7;' (without any mention anywhere >of 'extern') does in C++ is, AFAICT, exactly the same as a similar >definition with static, namely 'static const int foo = 7;'. Is that not dependent upon scope? For example: class x { static const unsigned long FRED = 0xabcdef00ul; }; requires an additional declaration in a compilation unit, e.g. const unsigned long x::FRED; While namespace y { const unsigned long FRED = 0xabcdef00ul; }; doesn't require an additional declaration. |
| "daniel...@gmail.com" <danielaparker@gmail.com>: Oct 28 08:29PM -0700 On Thursday, October 28, 2021 at 4:50:05 PM UTC-4, Chris M. Thomasson wrote: > Well, what do you think? > https://youtu.be/3abgNkpIY98 > https://www.youtube.com/watch?v=3abgNkpIY98 Pretty cool! Daniel |
| You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment