Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Computers are like air conditioners. Both stop working, if you open windows. -- Adam Heath


devel / comp.lang.c++ / Re: “ChattyG takes a college freshman C/C++ programming exam”

SubjectAuthor
* “ChattyG takes a college freshman C/C++ programmiLynn McGuire
+- Re: “ChattyG takes a college freshman C/C++ proChris M. Thomasson
+* Re: “ChattyG takes a college freshman C/C++ proChristian Gollwitzer
|`- Re: “ChattyG takes a college freshman C/C++ proChris M. Thomasson
+* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
|`* Re: “ChattyG takes a college freshman C/C++ progrjak
| +- Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
| +* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
| |+- Re: “ChattyG takes a college freshman C/C++Anton Shepelev
| |+* Re: “ChattyG takes a college freshman C/C++ procandycanearter07
| ||+* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
| |||`* Re: “ChattyG takes a college freshman C/C++ progrPavel
| ||| +- Re: “ChattyG takes a college freshman C/C++ proRichard Damon
| ||| `* Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
| |||  `* Re: “ChattyG takes a college freshman C/C++ progrPavel
| |||   +- Re: “ChattyG takes a college freshman C/C++ proRichard Damon
| |||   `- Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
| ||`* Re: “ChattyG takes a college freshman C/C++ proChris M. Thomasson
| || +* Re: “ChattyG takes a college freshman C/C++ proRichard Damon
| || |`* Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
| || | `- Re: “ChattyG takes a college freshman C/C++ proChris M. Thomasson
| || `* Re: “ChattyG takes a college freshman C/C++ proMarioCCCP
| ||  `- Re: “ChattyG takes a college freshman C/C++Keith Thompson
| |+- Re: “ChattyG takes a college freshman C/C++Ben Bacarisse
| |+* Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
| ||`- Re: “ChattyG takes a college freshman C/C++Anton Shepelev
| |`* Re: “ChattyG takes a college freshman C/C++Blue-Maned_Hawk
| | +* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
| | |+* Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
| | ||`* Re: “ChattyG takes a college freshman C/C++ proChris M. Thomasson
| | || `* Re: Re: “ChattyG takes a college freshman C/C++ programming exam”Scott Lurndal
| | ||  `- Re: “ChattyG takes a college freshman C/C++ proChris M. Thomasson
| | |`* Re: “ChattyG takes a college freshman C/C++Blue-Maned_Hawk
| | | `* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
| | |  +* Re: “ChattyG takes a college freshman C/C++ programming exam”Scott Lurndal
| | |  |`* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
| | |  | +- Re: “ChattyG takes a college freshman C/C++ programming exam”Scott Lurndal
| | |  | +- Re: “ChattyG takes a college freshman C/C++ programming exam”Scott Lurndal
| | |  | `- Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
| | |  `- Re: “ChattyG takes a college freshman C/C++Ben Bacarisse
| | `* Re: “ChattyG takes a college freshman C/C++Keith Thompson
| |  +* Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
| |  |`* Re: “ChattyG takes a college freshman C/C++Keith Thompson
| |  | +- Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
| |  | +- Re: “ChattyG takes a college freshman C/C++ programming exam”Scott Lurndal
| |  | `- Re: “ChattyG takes a college freshman C/C++Tim Rentsch
| |  `* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
| |   `- Re: “ChattyG takes a college freshman C/C++Keith Thompson
| `- Re: “ChattyG takes a college freshman C/C++ proJames Kuyper
+* Re: “ChattyG takes a college freshman C/C++ proChris M. Thomasson
|+- Re: “ChattyG takes a college freshman C/C++ proChris M. Thomasson
|+- Re: “ChattyG takes a college freshman C/C++Anton Shepelev
|`* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
| `- Re: “ChattyG takes a college freshman C/C++ proChris M. Thomasson
`* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
 `* Re: “ChattyG takes a college freshman C/C++Phil Carmody
  `* Re: “ChattyG takes a college freshman C/C++Anton Shepelev
   `- Re: “ChattyG takes a college freshman C/C++Phil Carmody

Pages:123
Re: “ChattyG takes a college freshman C/C++ programming exam”

<ughn0b$1kkth$2@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2195&group=comp.lang.c%2B%2B#2195

  copy link   Newsgroups: comp.lang.c++ comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: richard@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re:_“ChattyG_takes_a_college_freshman_C/C++_pro
gramming_exam”
Date: Sun, 15 Oct 2023 17:53:15 -0400
Organization: i2pn2 (i2pn.org)
Message-ID: <ughn0b$1kkth$2@i2pn2.org>
References: <ufne0r$15ple$1@dont-email.me>
<20231007235448.25c4986f123c88ff65d2f103@gmail.moc>
<uftmh9$2vieq$1@dont-email.me>
<20231008125543.518cab44cdefed7e8af393c8@gmail.moc>
<ufu3e1$2voq4$2@dont-email.me>
<20231008150352.5dfc8262244889e65a132733@gmail.moc>
<PpXWM.24780$w4ec.17265@fx14.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 15 Oct 2023 21:53:15 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="1725361"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <PpXWM.24780$w4ec.17265@fx14.iad>
 by: Richard Damon - Sun, 15 Oct 2023 21:53 UTC

On 10/15/23 3:51 PM, Pavel wrote:
> Anton Shepelev wrote:
>> candycanearter07 to Anton Shepelev:
>>
>>>> And although C allows the definition of self-referential
>>>> structs, it does [not] allow the declaration of self-
>>>> referencial functions.
>>>
>>> What if you typedef'd the function pointer?
>>
>> That's what I did:
>>
>>     typedef void   (*fp   )( void );
>>     typedef stm_fp (*func )( struct my_struct * s, int i );
>>
>> As you see, the `func' still must return something other
>> than func...
>>
>>> Also, you could probably get away with it by just setting
>>> it to a void pointer and casting the return value to the
>>> function pointer.
>>
>> Yes, to a void /function/ pointer, because void* is
>> incompatible with void(*)(void).  And then it is not a
>> truely recursive declaration, and requires additional work
>> to invoke.
> ...
>
> The below seems to work in gcc, unsure if this is standard-compliant but
> does not require extra work to invoke. If it is, I understand that the
> fptr type is not that of pointer to f, but your question does not
> qualify whether the function should return the value of a pointer to
> itself or a pointer of type of itself or both. If the former, the answer
> seems to be "yes" because the second call by pointer seems to work, no?
>
>
> typedef void* (*vfptr_t)();
>
> vfptr_t f(int n)
> {
>   printf("I am f n=%d\n", n);
>   return (vfptr_t)&f;
> }
>
> int
> main(int argc, char* argv[])
> {
>   vfptr_t fptr = f(5);
>   fptr(6);
>   return 0;
> }

No, it doesn't meet the strict definition of the challenge, as if it
did, then the following would work:

int
main()
{ vfptr_t fptr1 = f(5);
vfptr_t fptr2 = fptr1(6);
return 0;
}

as the pointer needs to act just like the function.

It seems that the best that can be done is to have the function actually
return a pointer to some function type, and then cast that to another
type that represents a function that returns a pointer the that function
type.

The issue is that to make it return the right type without needing a
cast, forces an infinite level of indirection in the type, while with
the cast, in adding one level, makes things work.

The problem is that in calling, we are effectively removing a level of
indirection from the definition and the only sort of number that can be
reduced by 1 and still be the same is an infinite number.

Re: “ChattyG takes a college freshman C/C++ programming exam”

<ugictr$vur3$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2198&group=comp.lang.c%2B%2B#2198

  copy link   Newsgroups: comp.lang.c++ comp.lang.c
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuyper@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re:_“ChattyG_takes_a_college_freshman_C/C++_pro
gramming_exam”
Date: Mon, 16 Oct 2023 00:07:23 -0400
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <ugictr$vur3$1@dont-email.me>
References: <ufne0r$15ple$1@dont-email.me>
<20231007235448.25c4986f123c88ff65d2f103@gmail.moc>
<uftmh9$2vieq$1@dont-email.me>
<20231008125543.518cab44cdefed7e8af393c8@gmail.moc>
<ufu3e1$2voq4$2@dont-email.me>
<20231008150352.5dfc8262244889e65a132733@gmail.moc>
<PpXWM.24780$w4ec.17265@fx14.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 16 Oct 2023 04:07:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="488f1f992c1470c99c5846f1006d6bf1";
logging-data="1047395"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hniZh7JFm9PXc/8fda9zXArAfbRb0hmI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:NxbKQaDmvL/4ItER+wlleRQKINA=
Content-Language: en-US
In-Reply-To: <PpXWM.24780$w4ec.17265@fx14.iad>
 by: James Kuyper - Mon, 16 Oct 2023 04:07 UTC

On 10/15/23 15:51, Pavel wrote:
> Anton Shepelev wrote:
>> candycanearter07 to Anton Shepelev:
>>
>>>> And although C allows the definition of self-referential
>>>> structs, it does [not] allow the declaration of self-
>>>> referencial functions.

Just for the sake of those who might not remember (I'm not suggesting
that you are one of them), this discussion is about C, even though
cross-posted to comp.lang.c++. Citations below are from the C standard.

....
> The below seems to work in gcc, unsure if this is standard-compliant but
> does not require extra work to invoke. If it is, I understand that the
> fptr type is not that of pointer to f, but your question does not
> qualify whether the function should return the value of a pointer to
> itself or a pointer of type of itself or both. If the former, the answer
> seems to be "yes" because the second call by pointer seems to work, no?
>
>
> typedef void* (*vfptr_t)();
>
> vfptr_t f(int n)
> {
> printf("I am f n=%d\n", n);
> return (vfptr_t)&f;
> }
>
> int
> main(int argc, char* argv[])
> {
> vfptr_t fptr = f(5);
> fptr(6);
> return 0;
> }

"If the function is defined with a type that is not compatible with the
type (of the expression) pointed to by the expression that denotes the
called function, the behavior is undefined." (6.5.2.2p9)

The type of f() is "vfptr_t f(int)". The type pointed at by fptr is
"void*()".

"For two function types to be compatible, both shall specify compatible
return types." (6.7.5.3p15)

void* and vfptr_t are not compatible types, so the type of f() is not
compatible with the type pointed at by fptr. The behavior is undefined,
even though your code makes no use of the value returned by that function.

Re: “ChattyG takes a college freshman C/C++ programming exam”

<aWlXM.71246$tnmf.36958@fx09.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2199&group=comp.lang.c%2B%2B#2199

  copy link   Newsgroups: comp.lang.c++ comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.us.feeder.erje.net!feeder.erje.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
Subject: Re:_“ChattyG_takes_a_college_freshman_C/C++_progr
amming_exam”
Newsgroups: comp.lang.c++,comp.lang.c
References: <ufne0r$15ple$1@dont-email.me>
<20231007235448.25c4986f123c88ff65d2f103@gmail.moc>
<uftmh9$2vieq$1@dont-email.me>
<20231008125543.518cab44cdefed7e8af393c8@gmail.moc>
<ufu3e1$2voq4$2@dont-email.me>
<20231008150352.5dfc8262244889e65a132733@gmail.moc>
<PpXWM.24780$w4ec.17265@fx14.iad> <ugictr$vur3$1@dont-email.me>
From: pauldontspamtolk@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17.1
MIME-Version: 1.0
In-Reply-To: <ugictr$vur3$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 81
Message-ID: <aWlXM.71246$tnmf.36958@fx09.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Tue, 17 Oct 2023 02:01:42 UTC
Date: Mon, 16 Oct 2023 22:01:37 -0400
X-Received-Bytes: 3522
 by: Pavel - Tue, 17 Oct 2023 02:01 UTC

James Kuyper wrote:
> On 10/15/23 15:51, Pavel wrote:
>> Anton Shepelev wrote:
>>> candycanearter07 to Anton Shepelev:
>>>
>>>>> And although C allows the definition of self-referential
>>>>> structs, it does [not] allow the declaration of self-
>>>>> referencial functions.
>
> Just for the sake of those who might not remember (I'm not suggesting
> that you are one of them), this discussion is about C, even though
> cross-posted to comp.lang.c++. Citations below are from the C standard.
>
> ...
>> The below seems to work in gcc, unsure if this is standard-compliant but
>> does not require extra work to invoke. If it is, I understand that the
>> fptr type is not that of pointer to f, but your question does not
>> qualify whether the function should return the value of a pointer to
>> itself or a pointer of type of itself or both. If the former, the answer
>> seems to be "yes" because the second call by pointer seems to work, no?
>>
>>
>> typedef void* (*vfptr_t)();
>>
>> vfptr_t f(int n)
>> {
>> printf("I am f n=%d\n", n);
>> return (vfptr_t)&f;
>> }
>>
>> int
>> main(int argc, char* argv[])
>> {
>> vfptr_t fptr = f(5);
>> fptr(6);
>> return 0;
>> }
>
> "If the function is defined with a type that is not compatible with the
> type (of the expression) pointed to by the expression that denotes the
> called function, the behavior is undefined." (6.5.2.2p9)
>
> The type of f() is "vfptr_t f(int)". The type pointed at by fptr is
> "void*()".
yes, I noticed. this works as well (with same parameter types):

/* cut here -----------------*/
#include <stdio.h>

typedef void* (*vfptr_t)(int);

vfptr_t f(int n)
{ printf("I am f n=%d\n", n);
return (vfptr_t)f;
}

int
main(int argc, char* argv[])
{ (void)argc;
(void)argv;
vfptr_t fptr = f(5);
fptr(6);
return 0;
} /* cut here -----------------*/

>
> "For two function types to be compatible, both shall specify compatible
> return types." (6.7.5.3p15)
I see, thanks.
>
> void* and vfptr_t are not compatible types, so the type of f() is not
> compatible with the type pointed at by fptr. The behavior is undefined,
> even though your code makes no use of the value returned by that function.
Doesn't it use the returned value by assigning it to fptr and then
calling f thru it?

Re: “ChattyG takes a college freshman C/C++ programming exam”

<ugks9k$1pa8g$5@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2200&group=comp.lang.c%2B%2B#2200

  copy link   Newsgroups: comp.lang.c++ comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: richard@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re:_“ChattyG_takes_a_college_freshman_C/C++_pro
gramming_exam”
Date: Mon, 16 Oct 2023 22:41:56 -0400
Organization: i2pn2 (i2pn.org)
Message-ID: <ugks9k$1pa8g$5@i2pn2.org>
References: <ufne0r$15ple$1@dont-email.me>
<20231007235448.25c4986f123c88ff65d2f103@gmail.moc>
<uftmh9$2vieq$1@dont-email.me>
<20231008125543.518cab44cdefed7e8af393c8@gmail.moc>
<ufu3e1$2voq4$2@dont-email.me>
<20231008150352.5dfc8262244889e65a132733@gmail.moc>
<PpXWM.24780$w4ec.17265@fx14.iad> <ugictr$vur3$1@dont-email.me>
<aWlXM.71246$tnmf.36958@fx09.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 17 Oct 2023 02:41:56 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="1878288"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <aWlXM.71246$tnmf.36958@fx09.iad>
 by: Richard Damon - Tue, 17 Oct 2023 02:41 UTC

On 10/16/23 10:01 PM, Pavel wrote:
> James Kuyper wrote:
>> On 10/15/23 15:51, Pavel wrote:
>>> Anton Shepelev wrote:
>>>> candycanearter07 to Anton Shepelev:
>>>>
>>>>>> And although C allows the definition of self-referential
>>>>>> structs, it does [not] allow the declaration of self-
>>>>>> referencial functions.
>>
>> Just for the sake of those who might not remember (I'm not suggesting
>> that you are one of them), this discussion is about C, even though
>> cross-posted to comp.lang.c++. Citations below are from the C standard.
>>
>> ...
>>> The below seems to work in gcc, unsure if this is standard-compliant but
>>> does not require extra work to invoke. If it is, I understand that the
>>> fptr type is not that of pointer to f, but your question does not
>>> qualify whether the function should return the value of a pointer to
>>> itself or a pointer of type of itself or both. If the former, the answer
>>> seems to be "yes" because the second call by pointer seems to work, no?
>>>
>>>
>>> typedef void* (*vfptr_t)();
>>>
>>> vfptr_t f(int n)
>>> {
>>>     printf("I am f n=%d\n", n);
>>>     return (vfptr_t)&f;
>>> }
>>>
>>> int
>>> main(int argc, char* argv[])
>>> {
>>>     vfptr_t fptr = f(5);
>>>     fptr(6);
>>>     return 0;
>>> }
>>
>> "If the function is defined with a type that is not compatible with the
>> type (of the expression) pointed to by the expression that denotes the
>> called function, the behavior is undefined." (6.5.2.2p9)
>>
>> The type of f() is "vfptr_t f(int)". The type pointed at by fptr is
>> "void*()".
> yes, I noticed. this works as well (with same parameter types):
>
> /* cut here -----------------*/
> #include <stdio.h>
>
> typedef void* (*vfptr_t)(int);
>
> vfptr_t f(int n)
> {
>   printf("I am f n=%d\n", n);
>   return (vfptr_t)f;
> }
>
> int
> main(int argc, char* argv[])
> {
>   (void)argc;
>   (void)argv;
>   vfptr_t fptr = f(5);
>   fptr(6);
>   return 0;
> }
> /* cut here -----------------*/
>
>
>>
>> "For two function types to be compatible, both shall specify compatible
>> return types." (6.7.5.3p15)
> I see, thanks.
>>
>> void* and vfptr_t are not compatible types, so the type of f() is not
>> compatible with the type pointed at by fptr. The behavior is undefined,
>> even though your code makes no use of the value returned by that
>> function.
> Doesn't it use the returned value by assigning it to fptr and then
> calling f thru it?
>
>

The issue is that the call to fptr(6) thinks it is calling a function
that return a void*, but it is actually calling a function that returns
a pointer to a function that returns a void*, those aren't the same type
of function, so you get undefined behavior.

And that is why you needed the cast in the function.

It is also why if you made the second call into:

vfptr_t fptr2 = fptr(6);

you would get an error, as the function type of fptr doesn't return
something compatible with vfptr_t. That is using the return value of the
call through the returned function pointer, as that is where the error is.

Re: “ChattyG takes a college freshman C/C++ programming exam”

<ugmccu$328ca$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2205&group=comp.lang.c%2B%2B#2205

  copy link   Newsgroups: comp.lang.c++ comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuyper@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re:_“ChattyG_takes_a_college_freshman_C/C++_pro
gramming_exam”
Date: Tue, 17 Oct 2023 12:22:53 -0400
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <ugmccu$328ca$1@dont-email.me>
References: <ufne0r$15ple$1@dont-email.me>
<20231007235448.25c4986f123c88ff65d2f103@gmail.moc>
<uftmh9$2vieq$1@dont-email.me>
<20231008125543.518cab44cdefed7e8af393c8@gmail.moc>
<ufu3e1$2voq4$2@dont-email.me>
<20231008150352.5dfc8262244889e65a132733@gmail.moc>
<PpXWM.24780$w4ec.17265@fx14.iad> <ugictr$vur3$1@dont-email.me>
<aWlXM.71246$tnmf.36958@fx09.iad> <ugl46n$2oe4a$2@dont-email.me>
<20231017140517.03e9dbe931d4d33f14ae43a9@gmail.moc>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 17 Oct 2023 16:22:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a1ced4e1c6260113d794b3aa71715acd";
logging-data="3219850"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yushR/xxcMkuiMbugSCmi0qUg3McVSJI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:l8jW78AlGKEBpABHluZ+hs2H4xI=
In-Reply-To: <20231017140517.03e9dbe931d4d33f14ae43a9@gmail.moc>
Content-Language: en-US
 by: James Kuyper - Tue, 17 Oct 2023 16:22 UTC

On 10/17/23 07:05, Anton Shepelev wrote:
> James Kuyper:
>
>> One of the most common and most dangerous things that can
>> happen when the behavior of code is undefined, is that it
>> happens to behave in precisely the fashion you
>> unjustifiably expected it to behave, leaving you unaware
>> of the [Ant: a?] flaw in your program.

You're right - "a" works better; we don't know that it's the only flaw.

Re: “ChattyG takes a college freshman C/C++ programming exam”

<87h6mhbjhc.fsf@fatphil.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2259&group=comp.lang.c%2B%2B#2259

  copy link   Newsgroups: comp.lang.c++ comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pc+usenet@asdf.org (Phil Carmody)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: “ChattyG takes a college freshman C/C++
programming exam”
Date: Mon, 23 Oct 2023 15:39:59 +0300
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <87h6mhbjhc.fsf@fatphil.org>
References: <ufne0r$15ple$1@dont-email.me>
<20231012105315.b443bb972f1d082a387c5eac@g{oogle}mail.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="fb0d125bdad8fe799150db7ddadb0503";
logging-data="3288653"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++wiuC5OFbnjkVrR2KOj1c"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:h7VBnkfUrULRYaW7hrPzxeDFZJQ=
sha1:XaHVNGbDO1LTKHe8B1TRBkEDO28=
 by: Phil Carmody - Mon, 23 Oct 2023 12:39 UTC

"Antwrong" Shepelev <anton.txt@g{oogle}mail.com> writes:
> Lynn McGuire:
>
>> ChattyG takes a college freshman C/C++ programming exam
>> https://www.theregister.com/2023/10/03/chatgpt_code_college
>
> By the way, the actual paper does not mention anything
> called ChattyG. The journalist must have used the term
> erroneously.

Incorrect. For reasons that should now be obvious.

Phil
--
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

Re: “ChattyG takes a college freshman C/C++ programming exam”

<20231023164524.973fa2b222bea05dd8eca11f@g{oogle}mail.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2260&group=comp.lang.c%2B%2B#2260

  copy link   Newsgroups: comp.lang.c++ comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton.txt@g{oogle}mail.com (Anton Shepelev)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: “ChattyG takes a college freshman C/C++
programming exam”
Date: Mon, 23 Oct 2023 16:45:24 +0300
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <20231023164524.973fa2b222bea05dd8eca11f@g{oogle}mail.com>
References: <ufne0r$15ple$1@dont-email.me>
<20231012105315.b443bb972f1d082a387c5eac@g{oogle}mail.com>
<87h6mhbjhc.fsf@fatphil.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="d58e1b84867d0be2748bdbd8930364cf";
logging-data="3337028"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183UzwOIAuHGd2KT3YsGEqf2mhJsUyfdMk="
Cancel-Lock: sha1:zbMI5XSs90sNgl4l/tBTBUcbwik=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
 by: Anton Shepelev - Mon, 23 Oct 2023 13:45 UTC

Phil Carmody to Anton Shepelev:

> > Anton Shepelev:
> >
> > > ChattyG takes a college freshman C/C++ programming exam
> > > https://www.theregister.com/2023/10/03/chatgpt_code_college
> >
> > By the way, the actual paper does not mention anything
> > called ChattyG. The journalist must have used the term
> > erroneously.
>
> Incorrect. For reasons that should now be obvious.

No, not to me.

--
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments

Re: “ChattyG takes a college freshman C/C++ programming exam”

<87o7gj9qn3.fsf@fatphil.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2311&group=comp.lang.c%2B%2B#2311

  copy link   Newsgroups: comp.lang.c++ comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pc+usenet@asdf.org (Phil Carmody)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: “ChattyG takes a college freshman C/C++
programming exam”
Date: Sat, 28 Oct 2023 10:01:52 +0300
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <87o7gj9qn3.fsf@fatphil.org>
References: <ufne0r$15ple$1@dont-email.me>
<20231012105315.b443bb972f1d082a387c5eac@g{oogle}mail.com>
<87h6mhbjhc.fsf@fatphil.org>
<20231023164524.973fa2b222bea05dd8eca11f@g{oogle}mail.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="20c640a66519b7d9f2bd9900f4fe8d89";
logging-data="2911571"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6Kzxvg5Nr5YO9x4IlkY9Y"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:o0NJs0AbgJwQBvBO5QqBiY9Ffb8=
sha1:IebGKVoiIr/8VqmPwYCzZzSJ5oU=
 by: Phil Carmody - Sat, 28 Oct 2023 07:01 UTC

Anton Shepelev <anton.txt@g{oogle}mail.com> writes:
> Phil Carmody to Anton Shepelev:
>> > Anton Shepelev:
>> >
>> > > ChattyG takes a college freshman C/C++ programming exam
>> > > https://www.theregister.com/2023/10/03/chatgpt_code_college
>> >
>> > By the way, the actual paper does not mention anything
>> > called ChattyG. The journalist must have used the term
>> > erroneously.
>>
>> Incorrect. For reasons that should now be obvious.
>
> No, not to me.

Yet you felt the need to edit my post when replying to it.

No entity gets to enforce how other people refer to them.

Phil
--
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor