Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #92556 > unrolled thread

What does this code print ?

Started byBonita Montero <Bonita.Montero@gmail.com>
First post2023-10-11 05:30 +0200
Last post2023-10-25 23:12 -0700
Articles 20 on this page of 134 — 12 participants

Back to article view | Back to comp.lang.c++


Contents

  What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-11 05:30 +0200
    Re: What does this code print ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-10-11 14:03 +0100
      Re: What does this code print ? gazelle@shell.xmission.com (Kenny McCormack) - 2023-10-11 13:12 +0000
        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-11 19:22 +0200
          Re: What does this code print ? scott@slp53.sl.home (Scott Lurndal) - 2023-10-11 17:41 +0000
            Re: What does this code print ? Bo Persson <bo@bo-persson.se> - 2023-10-11 20:24 +0200
            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-13 05:24 +0200
              Re: What does this code print ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-10-13 17:53 +0100
                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-14 15:50 +0200
          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-13 12:12 -0400
            Re: What does this code print ? scott@slp53.sl.home (Scott Lurndal) - 2023-10-13 17:27 +0000
            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-14 15:52 +0200
              Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-14 11:26 -0400
                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:08 +0200
                  Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-15 12:55 -0700
                  Re: What does this code print ? Richard Damon <news.x.richarddamon@xoxy.net> - 2023-10-15 22:19 -0400
                    Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-18 20:58 -0700
      Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-11 19:21 +0200
      Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-11 12:41 -0700
        Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-11 12:43 -0700
        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-13 05:25 +0200
      Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-12 20:50 -0700
        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-13 08:50 +0200
          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-13 12:15 -0400
            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-14 15:53 +0200
              Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-14 11:26 -0400
                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:00 +0200
                  Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-15 13:15 -0400
                    Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-17 07:47 +0200
                      Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-17 11:34 -0700
          Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-13 16:34 +0000
            Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-13 13:12 -0700
              Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-14 02:36 +0000
                Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-13 20:44 -0700
                Re: What does this code print ? Paavo Helde <eesnimi@osa.pri.ee> - 2023-10-14 11:51 +0300
                  Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-17 11:35 -0700
                    Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-17 20:06 +0000
                      Re: What does this code print ? Paavo Helde <eesnimi@osa.pri.ee> - 2023-10-18 11:43 +0300
                        Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-18 17:29 +0000
                          Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-18 11:31 -0700
                            Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-19 14:43 -0700
            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-14 15:54 +0200
              Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-14 18:05 +0000
                Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-14 14:58 -0400
                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 08:58 +0200
          Re: What does this code print ? Richard Damon <news.x.richarddamon@xoxy.net> - 2023-10-14 12:47 -0400
            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:07 +0200
              Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:12 +0200
                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:16 +0200
                  Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-15 13:35 -0400
                    Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-17 07:48 +0200
                      Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-17 23:04 -0400
                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 19:58 +0200
                          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-19 14:39 -0400
                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 19:58 +0200
                          Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-19 18:06 +0000
                            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 20:11 +0200
                              Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-19 19:20 +0000
                                Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-19 16:06 -0400
                                Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-19 14:45 -0700
                                  Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-19 23:26 +0000
                                    Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-20 09:19 +0200
                                      Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-20 05:47 -0400
                                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-20 17:59 +0200
                                          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-20 19:16 -0700
                                            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-21 08:02 +0200
                                              Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-21 08:38 -0700
                                                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-21 19:40 +0200
                                                  Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-21 10:54 -0700
                                                    Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-21 20:34 +0200
                                                      Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-21 12:45 -0700
                                                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-22 04:18 +0200
                                                          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-21 19:28 -0700
                                                            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-22 06:53 +0200
                                                              Re: What does this code print ? Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2023-10-22 09:59 +0000
                                                              Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-22 07:12 -0700
                                                                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-23 19:05 +0200
                                                                  Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-23 10:40 -0700
                                                                    Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 16:03 +0200
                                                                      Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 07:28 -0700
                                                                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 17:01 +0200
                                                                          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 08:28 -0700
                                                                            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 18:27 +0200
                                                                              Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 10:05 -0700
                                                                                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 19:08 +0200
                                                                                  Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 10:39 -0700
                                                                                    Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 20:25 +0200
                                                                                      Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-24 19:48 +0000
                                                                                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 10:54 +0200
                                                                                          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 08:43 -0700
                                                                                            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 17:57 +0200
                                                                          Re: What does this code print ? Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2023-10-24 16:40 +0000
                                                                            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 19:07 +0200
                                                                        Re: What does this code print ? scott@slp53.sl.home (Scott Lurndal) - 2023-10-24 15:25 +0000
                                                                          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 08:34 -0700
                                                                      Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-24 16:34 +0000
                                                                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 19:05 +0200
                                      Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-20 14:50 +0000
                                        Re: What does this code print ? Bo Persson <bo@bo-persson.se> - 2023-10-20 17:34 +0200
                                          Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-20 15:59 +0000
                                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-20 18:00 +0200
                                          Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-20 16:06 +0000
                                            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-20 18:40 +0200
                                              Re: What does this code print ? gazelle@shell.xmission.com (Kenny McCormack) - 2023-10-20 20:07 +0000
                                                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-21 08:04 +0200
                Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-15 13:35 -0400
                  Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-17 07:50 +0200
                    Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-17 23:08 -0400
                      Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 20:02 +0200
                        Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-19 14:43 -0400
                      Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 20:02 +0200
              Re: What does this code print ? scott@slp53.sl.home (Scott Lurndal) - 2023-10-15 14:36 +0000
                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 18:15 +0200
                  Re: What does this code print ? Richard Damon <news.x.richarddamon@xoxy.net> - 2023-10-15 22:23 -0400
                    Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-17 07:51 +0200
                      Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-17 23:08 -0400
              Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-15 13:25 -0400
          Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-14 11:33 -0700
            Re: What does this code print ? Paavo Helde <eesnimi@osa.pri.ee> - 2023-10-14 21:54 +0300
              Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-14 11:56 -0700
              Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-24 15:53 -0700
                Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 15:07 +0200
                  Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 08:43 -0700
                    Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 18:01 +0200
                      Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 09:21 -0700
                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 18:24 +0200
                          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 11:23 -0700
                            Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-25 15:02 -0700
                            Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-26 07:13 +0200
                              Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 23:09 -0700
                          Re: What does this code print ? James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-10-25 23:55 -0400
                      Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-25 15:01 -0700
                        Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-26 07:15 +0200
                          Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 23:12 -0700

Page 1 of 7  [1] 2 3 4 5 6 7  Next page →


#92556 — What does this code print ?

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-10-11 05:30 +0200
SubjectWhat does this code print ?
Message-ID<ug54sf$1ki2m$1@dont-email.me>
#include <iostream>

using namespace std;

int main()
{
	auto lambda = []( int a ) -> int
	{
		thread_local int i = 0;
		return i++ + a;
	};
	int (__fastcall *volatile pFnFastcall)( int ) = lambda;
	int (__stdcall *volatile pFnStdcall)( int ) = lambda;
	cout << pFnFastcall( 10 ) << endl;
	cout << pFnStdcall( 9 ) << endl;
}

Don't compile it yourself, just guess.

[toc] | [next] | [standalone]


#92575

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2023-10-11 14:03 +0100
Message-ID<87lec95n0t.fsf@bsb.me.uk>
In reply to#92556
Bonita Montero <Bonita.Montero@gmail.com> writes:

> #include <iostream>
>
> using namespace std;
>
> int main()
> {
> 	auto lambda = []( int a ) -> int
> 	{
> 		thread_local int i = 0;
> 		return i++ + a;
> 	};
> 	int (__fastcall *volatile pFnFastcall)( int ) = lambda;
> 	int (__stdcall *volatile pFnStdcall)( int ) = lambda;
> 	cout << pFnFastcall( 10 ) << endl;
> 	cout << pFnStdcall( 9 ) << endl;
> }
>
> Don't compile it yourself,

An easy injunction to follow since it has syntax errors!  Presumably
those undeclared identifiers (or proprietary keywords?) have some
meaning to your compiler.

> just guess.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#92576

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2023-10-11 13:12 +0000
Message-ID<ug66v8$21ehl$1@news.xmission.com>
In reply to#92575
In article <87lec95n0t.fsf@bsb.me.uk>,
Ben Bacarisse  <ben.usenet@bsb.me.uk> wrote:
>Bonita Montero <Bonita.Montero@gmail.com> writes:
>
>> #include <iostream>
>>
>> using namespace std;
>>
>> int main()
>> {
>> 	auto lambda = []( int a ) -> int
>> 	{
>> 		thread_local int i = 0;
>> 		return i++ + a;
>> 	};
>> 	int (__fastcall *volatile pFnFastcall)( int ) = lambda;
>> 	int (__stdcall *volatile pFnStdcall)( int ) = lambda;
>> 	cout << pFnFastcall( 10 ) << endl;
>> 	cout << pFnStdcall( 9 ) << endl;
>> }
>>
>> Don't compile it yourself,
>
>An easy injunction to follow since it has syntax errors!  Presumably
>those undeclared identifiers (or proprietary keywords?) have some
>meaning to your compiler.

Actually, it is pretty easy to answer OP's question.  Here's what it
prints:

<stdin>: In function 'int main()':
<stdin>:12:8: error: '__fastcall' was not declared in this scope
<stdin>:12:3: error: expected primary-expression before 'int'
<stdin>:13:8: error: '__stdcall' was not declared in this scope
<stdin>:13:3: error: expected primary-expression before 'int'
<stdin>:14:11: error: 'pFnFastcall' was not declared in this scope
<stdin>:15:11: error: 'pFnStdcall' was not declared in this scope

And it is, in theory at least, possible to predict that without using a
compiler (though, truth to be told, I did cheat and use the compiler).

-- 
The randomly chosen signature file that would have appeared here is more than 4
lines long.  As such, it violates one or more Usenet RFCs.  In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
	http://user.xmission.com/~gazelle/Sigs/InsaneParty

[toc] | [prev] | [next] | [standalone]


#92581

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-10-11 19:22 +0200
Message-ID<ug6lk8$1ur0k$2@dont-email.me>
In reply to#92576
Am 11.10.2023 um 15:12 schrieb Kenny McCormack:

> Actually, it is pretty easy to answer OP's question.  Here's what it
> prints:
> 
> <stdin>: In function 'int main()':
> <stdin>:12:8: error: '__fastcall' was not declared in this scope
> <stdin>:12:3: error: expected primary-expression before 'int'
> <stdin>:13:8: error: '__stdcall' was not declared in this scope
> <stdin>:13:3: error: expected primary-expression before 'int'
> <stdin>:14:11: error: 'pFnFastcall' was not declared in this scope
> <stdin>:15:11: error: 'pFnStdcall' was not declared in this scope
> 
> And it is, in theory at least, possible to predict that without using a
> compiler (though, truth to be told, I did cheat and use the compiler).

Use a compiler which knows __fastcall and __stdcall.

[toc] | [prev] | [next] | [standalone]


#92582

Fromscott@slp53.sl.home (Scott Lurndal)
Date2023-10-11 17:41 +0000
Message-ID<P6BVM.37407$rbid.23540@fx18.iad>
In reply to#92581
Bonita Montero <Bonita.Montero@gmail.com> writes:
>Am 11.10.2023 um 15:12 schrieb Kenny McCormack:
>
>> Actually, it is pretty easy to answer OP's question.  Here's what it
>> prints:
>> 
>> <stdin>: In function 'int main()':
>> <stdin>:12:8: error: '__fastcall' was not declared in this scope
>> <stdin>:12:3: error: expected primary-expression before 'int'
>> <stdin>:13:8: error: '__stdcall' was not declared in this scope
>> <stdin>:13:3: error: expected primary-expression before 'int'
>> <stdin>:14:11: error: 'pFnFastcall' was not declared in this scope
>> <stdin>:15:11: error: 'pFnStdcall' was not declared in this scope
>> 
>> And it is, in theory at least, possible to predict that without using a
>> compiler (though, truth to be told, I did cheat and use the compiler).
>
>Use a compiler which knows __fastcall and __stdcall.
>

Why?

gcc and clang are far superior.

[toc] | [prev] | [next] | [standalone]


#92585

FromBo Persson <bo@bo-persson.se>
Date2023-10-11 20:24 +0200
Message-ID<koo7ikFbrgsU1@mid.individual.net>
In reply to#92582
On 2023-10-11 at 19:41, Scott Lurndal wrote:
> Bonita Montero <Bonita.Montero@gmail.com> writes:
>> Am 11.10.2023 um 15:12 schrieb Kenny McCormack:
>>
>>> Actually, it is pretty easy to answer OP's question.  Here's what it
>>> prints:
>>>
>>> <stdin>: In function 'int main()':
>>> <stdin>:12:8: error: '__fastcall' was not declared in this scope
>>> <stdin>:12:3: error: expected primary-expression before 'int'
>>> <stdin>:13:8: error: '__stdcall' was not declared in this scope
>>> <stdin>:13:3: error: expected primary-expression before 'int'
>>> <stdin>:14:11: error: 'pFnFastcall' was not declared in this scope
>>> <stdin>:15:11: error: 'pFnStdcall' was not declared in this scope
>>>
>>> And it is, in theory at least, possible to predict that without using a
>>> compiler (though, truth to be told, I did cheat and use the compiler).
>>
>> Use a compiler which knows __fastcall and __stdcall.
>>
> 
> Why?
> 
> gcc and clang are far superior.

The irony is that the compiler that "knows them", also knows to ignore 
them. That's why the lambda is compatible with both.

They used to have a meaning for 32-bit Windows.

[toc] | [prev] | [next] | [standalone]


#92667

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-10-13 05:24 +0200
Message-ID<ugad9a$2va82$1@dont-email.me>
In reply to#92582
Am 11.10.2023 um 19:41 schrieb Scott Lurndal:

> Bonita Montero <Bonita.Montero@gmail.com> writes:

>> Use a compiler which knows __fastcall and __stdcall.

> Why?
> gcc and clang are far superior.

In this case it's about functionality, not performance.
And clang-cl supports __fastcall and __stdcall also.

[toc] | [prev] | [next] | [standalone]


#92781

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2023-10-13 17:53 +0100
Message-ID<87o7h231lr.fsf@bsb.me.uk>
In reply to#92667
Bonita Montero <Bonita.Montero@gmail.com> writes:

> Am 11.10.2023 um 19:41 schrieb Scott Lurndal:
>
>> Bonita Montero <Bonita.Montero@gmail.com> writes:
>
>>> Use a compiler which knows __fastcall and __stdcall.
>
>> Why?
>> gcc and clang are far superior.
>
> In this case it's about functionality, not performance.
> And clang-cl supports __fastcall and __stdcall also.

Here, clang reports:

xx.cc:12:7: warning: '__fastcall' calling convention is not supported for this target [-Wignored-attributes]
        int (__fastcall *volatile pFnFastcall)( int ) = lambda;
             ^
xx.cc:13:7: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
        int (__stdcall *volatile pFnStdcall)( int ) = lambda;

so "supported" in the sense that it's not a syntax error.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#92818

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-10-14 15:50 +0200
Message-ID<uge6bt$3spt4$1@dont-email.me>
In reply to#92781
Am 13.10.2023 um 18:53 schrieb Ben Bacarisse:
> Bonita Montero <Bonita.Montero@gmail.com> writes:
> 
>> Am 11.10.2023 um 19:41 schrieb Scott Lurndal:
>>
>>> Bonita Montero <Bonita.Montero@gmail.com> writes:
>>
>>>> Use a compiler which knows __fastcall and __stdcall.
>>
>>> Why?
>>> gcc and clang are far superior.
>>
>> In this case it's about functionality, not performance.
>> And clang-cl supports __fastcall and __stdcall also.
> 
> Here, clang reports:

clang-cl, not clang.

> 
> xx.cc:12:7: warning: '__fastcall' calling convention is not supported for this target [-Wignored-attributes]
>          int (__fastcall *volatile pFnFastcall)( int ) = lambda;
>               ^
> xx.cc:13:7: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
>          int (__stdcall *volatile pFnStdcall)( int ) = lambda;
> 
> so "supported" in the sense that it's not a syntax error.
> 

[toc] | [prev] | [next] | [standalone]


#92775

FromRichard Damon <richard@damon-family.org>
Date2023-10-13 12:12 -0400
Message-ID<ugbq8q$19fre$2@i2pn2.org>
In reply to#92581
On 10/11/23 1:22 PM, Bonita Montero wrote:
> Am 11.10.2023 um 15:12 schrieb Kenny McCormack:
> 
>> Actually, it is pretty easy to answer OP's question.  Here's what it
>> prints:
>>
>> <stdin>: In function 'int main()':
>> <stdin>:12:8: error: '__fastcall' was not declared in this scope
>> <stdin>:12:3: error: expected primary-expression before 'int'
>> <stdin>:13:8: error: '__stdcall' was not declared in this scope
>> <stdin>:13:3: error: expected primary-expression before 'int'
>> <stdin>:14:11: error: 'pFnFastcall' was not declared in this scope
>> <stdin>:15:11: error: 'pFnStdcall' was not declared in this scope
>>
>> And it is, in theory at least, possible to predict that without using a
>> compiler (though, truth to be told, I did cheat and use the compiler).
> 
> Use a compiler which knows __fastcall and __stdcall.
> 
> 

But ANY program using those, that is to be interpreted as "Standard 
C++", has, by the Standard "Undefined Behavior".

So, the answer, when posted as a general "C++" question, is, it does 
what ever the implementation wants it to do.

To get your answer, you need to limit the "Language" of the program to 
the particular implementation you desire.

I could CORRECTLY state (if I want to go to the effort) that when I 
complied the program, its output was "Bonita is a idiot", because that 
is what the Damon C++ compiler generated, and it is fully conforming.

(And that answer IS a correct statement).

[toc] | [prev] | [next] | [standalone]


#92791

Fromscott@slp53.sl.home (Scott Lurndal)
Date2023-10-13 17:27 +0000
Message-ID<v6fWM.8285$igw9.559@fx37.iad>
In reply to#92775
Richard Damon <richard@damon-family.org> writes:
>On 10/11/23 1:22 PM, Bonita Montero wrote:
>> Am 11.10.2023 um 15:12 schrieb Kenny McCormack:
>> 
>>> Actually, it is pretty easy to answer OP's question.  Here's what it
>>> prints:
>>>
>>> <stdin>: In function 'int main()':
>>> <stdin>:12:8: error: '__fastcall' was not declared in this scope
>>> <stdin>:12:3: error: expected primary-expression before 'int'
>>> <stdin>:13:8: error: '__stdcall' was not declared in this scope
>>> <stdin>:13:3: error: expected primary-expression before 'int'
>>> <stdin>:14:11: error: 'pFnFastcall' was not declared in this scope
>>> <stdin>:15:11: error: 'pFnStdcall' was not declared in this scope
>>>
>>> And it is, in theory at least, possible to predict that without using a
>>> compiler (though, truth to be told, I did cheat and use the compiler).
>> 
>> Use a compiler which knows __fastcall and __stdcall.
>> 
>> 
>
>But ANY program using those, that is to be interpreted as "Standard 
>C++", has, by the Standard "Undefined Behavior".

And moreover, they only have different behavior on x86 (32-bit).

On x86_64, ARM64, et alia __fastcall/__stdcall are ignored, even by microsoft compilers.

[toc] | [prev] | [next] | [standalone]


#92819

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-10-14 15:52 +0200
Message-ID<uge6f5$3spt4$2@dont-email.me>
In reply to#92775
Am 13.10.2023 um 18:12 schrieb Richard Damon:
> On 10/11/23 1:22 PM, Bonita Montero wrote:
>> Am 11.10.2023 um 15:12 schrieb Kenny McCormack:
>>
>>> Actually, it is pretty easy to answer OP's question.  Here's what it
>>> prints:
>>>
>>> <stdin>: In function 'int main()':
>>> <stdin>:12:8: error: '__fastcall' was not declared in this scope
>>> <stdin>:12:3: error: expected primary-expression before 'int'
>>> <stdin>:13:8: error: '__stdcall' was not declared in this scope
>>> <stdin>:13:3: error: expected primary-expression before 'int'
>>> <stdin>:14:11: error: 'pFnFastcall' was not declared in this scope
>>> <stdin>:15:11: error: 'pFnStdcall' was not declared in this scope
>>>
>>> And it is, in theory at least, possible to predict that without using a
>>> compiler (though, truth to be told, I did cheat and use the compiler).
>>
>> Use a compiler which knows __fastcall and __stdcall.
>>
>>
> 
> But ANY program using those, that is to be interpreted as "Standard 
> C++", has, by the Standard "Undefined Behavior".

This is just a Windows program. If you don't like it, don't worry
about  it.Others might be able to understand this without Windows,
but you can't.



> 
> So, the answer, when posted as a general "C++" question, is, it does 
> what ever the implementation wants it to do.
> 
> To get your answer, you need to limit the "Language" of the program to 
> the particular implementation you desire.
> 
> I could CORRECTLY state (if I want to go to the effort) that when I 
> complied the program, its output was "Bonita is a idiot", because that 
> is what the Damon C++ compiler generated, and it is fully conforming.
> 
> (And that answer IS a correct statement).

[toc] | [prev] | [next] | [standalone]


#92829

FromRichard Damon <richard@damon-family.org>
Date2023-10-14 11:26 -0400
Message-ID<ugebv3$1gabn$1@i2pn2.org>
In reply to#92819
On 10/14/23 9:52 AM, Bonita Montero wrote:
> Am 13.10.2023 um 18:12 schrieb Richard Damon:
>> On 10/11/23 1:22 PM, Bonita Montero wrote:
>>> Am 11.10.2023 um 15:12 schrieb Kenny McCormack:
>>>
>>>> Actually, it is pretty easy to answer OP's question.  Here's what it
>>>> prints:
>>>>
>>>> <stdin>: In function 'int main()':
>>>> <stdin>:12:8: error: '__fastcall' was not declared in this scope
>>>> <stdin>:12:3: error: expected primary-expression before 'int'
>>>> <stdin>:13:8: error: '__stdcall' was not declared in this scope
>>>> <stdin>:13:3: error: expected primary-expression before 'int'
>>>> <stdin>:14:11: error: 'pFnFastcall' was not declared in this scope
>>>> <stdin>:15:11: error: 'pFnStdcall' was not declared in this scope
>>>>
>>>> And it is, in theory at least, possible to predict that without using a
>>>> compiler (though, truth to be told, I did cheat and use the compiler).
>>>
>>> Use a compiler which knows __fastcall and __stdcall.
>>>
>>>
>>
>> But ANY program using those, that is to be interpreted as "Standard 
>> C++", has, by the Standard "Undefined Behavior".
> 
> This is just a Windows program. If you don't like it, don't worry
> about  it.Others might be able to understand this without Windows,
> but you can't.
> 
> 

Who said I didn't understand it.

YOU are the one that doesn't seem to understand what a Standard says.

YOU didn't say "Windows", so YOU are the one that made the error, 
perhaps because you think all the world is just Windows, which is WRONG 
(and shows your ignorance).

> 
>>
>> So, the answer, when posted as a general "C++" question, is, it does 
>> what ever the implementation wants it to do.
>>
>> To get your answer, you need to limit the "Language" of the program to 
>> the particular implementation you desire.
>>
>> I could CORRECTLY state (if I want to go to the effort) that when I 
>> complied the program, its output was "Bonita is a idiot", because that 
>> is what the Damon C++ compiler generated, and it is fully conforming.
>>
>> (And that answer IS a correct statement).
> 

[toc] | [prev] | [next] | [standalone]


#92842

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-10-15 09:08 +0200
Message-ID<ugg350$cf8s$4@dont-email.me>
In reply to#92829
Am 14.10.2023 um 17:26 schrieb Richard Damon:

> Who said I didn't understand it.

You're a nerd and I know nerds.

[toc] | [prev] | [next] | [standalone]


#92866

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-10-15 12:55 -0700
Message-ID<ughg3b$m6i2$1@dont-email.me>
In reply to#92842
On 10/15/2023 12:08 AM, Bonita Montero wrote:
> Am 14.10.2023 um 17:26 schrieb Richard Damon:
> 
>> Who said I didn't understand it.
> 
> You're a nerd and I know nerds.

Huh? That is a very odd thing to say even for a naive troll. Okay Bonita 
The Beautiful Woman. Are you like the cruel puppet for real? The only 
way to defend yourself is with mental straining. Are you the real one?

https://www.thezorklibrary.com/history/cruel_puppet.html

___________________
Few creatures are more despised than the cruel puppet, one which uses 
its power not for good, evil or profit, but simply to hurt people's 
feelings. Staunch monarchs have been reduced to tears by these merciless 
shapeshifters; for it attacks by twisting itself into unflattering 
caricatures of its opponents, accompanied by jeers, rude noises and 
shocking accusations--which include the recital of nightly personal 
habits in excruciating detail, accusing its adversary's mother of 
shocking improprieties, reminding of weight gain, etc. They have also 
been known to practice existential put downs. "You're so ugly you're 
probably the creation of an unseen master who is controlling and shaping 
the world around you. Nothing is real and nothing you do will have any 
lasting effect on those around you. Welcome to the dark night of your 
soul" is but one example. More often, however, they just insult your 
knees. Insulting the cruel puppet in return is futile, for it feeds off 
of them. Straining to ignore these verbal attacks is the only known defense.

Residents of Gurth City were warned during the mid-tenth century to keep 
away from the Forest of Youth, as it was known home to cruel puppets.

During the Great Monster Uprising of the Second Age of Magic, cruel 
puppets were reported in the following regions: The abandoned Casino of 
Port Foozle, The Southern Wastes, The Coast Road near Borphee, Pheebor, 
Forest of Youth, Gurth Woodland Trail, the Lost Castle of Y'Syska, Crab 
Island, Egreth Castle, The Glass Maze, Bozbarland, Largoneth Castle, and 
the G.U.E. Tech Training Grounds in the Ethereal Plane of Atrii. Many 
perched in trees and other high and covert corners, raining handfuls of 
exploding chestnuts down upon luckless adventurers.
___________________

[toc] | [prev] | [next] | [standalone]


#92873

FromRichard Damon <news.x.richarddamon@xoxy.net>
Date2023-10-15 22:19 -0400
Message-ID<ugi6jr$ulpp$1@dont-email.me>
In reply to#92842
On 10/15/23 3:08 AM, Bonita Montero wrote:
> Am 14.10.2023 um 17:26 schrieb Richard Damon:
> 
>> Who said I didn't understand it.
> 
> You're a nerd and I know nerds.

So, you are wrong, but can't admit it.

[toc] | [prev] | [next] | [standalone]


#93986

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-10-18 20:58 -0700
Message-ID<ugq9hq$4t53$1@dont-email.me>
In reply to#92873
On 10/15/2023 7:19 PM, Richard Damon wrote:
> On 10/15/23 3:08 AM, Bonita Montero wrote:
>> Am 14.10.2023 um 17:26 schrieb Richard Damon:
>>
>>> Who said I didn't understand it.
>>
>> You're a nerd and I know nerds.
> 
> So, you are wrong, but can't admit it.

Basically, wrt Bonita:
_________
Cruel puppets are one of the most insidious creatures in fantasy worlds. 
They use their shapeshifting abilities and sharp tongues to inflict 
emotional pain on their victims, often targeting their deepest 
insecurities and vulnerabilities.

The cruel puppet's attacks are particularly effective because they are 
often unexpected and difficult to defend against. Victims may be tempted 
to engage the puppet in a battle of insults, but this is a losing 
proposition. The puppet thrives on conflict and will only become more 
emboldened by the victim's reactions.

Instead, the best defense against a cruel puppet is to ignore it. This 
can be difficult, especially when the puppet is taunting the victim with 
personal insults and accusations. However, it is important to remember 
that the puppet's words are designed to hurt and should not be taken 
seriously.

If the victim can remain calm and collected, the puppet will eventually 
lose interest and move on. However, if the victim reacts emotionally, 
the puppet will only continue to attack.

In the fantasy world of Gurth, cruel puppets are known to inhabit the 
Forest of Youth. During the Great Monster Uprising of the Second Age of 
Magic, cruel puppets were also reported in many other regions of the 
world, including the abandoned Casino of Port Foozle, the Southern 
Wastes, the Coast Road near Borphee, Pheebor, the Forest of Youth, Gurth 
Woodland Trail, the Lost Castle of Y'Syska, Crab Island, Egreth Castle, 
The Glass Maze, Bozbarland, Largoneth Castle, and the G.U.E. Tech 
Training Grounds in the Ethereal Plane of Atrii.

Adventurers who find themselves in these regions should be wary of cruel 
puppets. If they encounter one, it is best to avoid it if possible. If 
contact is unavoidable, it is important to remain calm and ignore the 
puppet's taunts.
_________

[toc] | [prev] | [next] | [standalone]


#92580

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-10-11 19:21 +0200
Message-ID<ug6li5$1ur0k$1@dont-email.me>
In reply to#92575
Am 11.10.2023 um 15:03 schrieb Ben Bacarisse:
> Bonita Montero <Bonita.Montero@gmail.com> writes:
> 
>> #include <iostream>
>>
>> using namespace std;
>>
>> int main()
>> {
>> 	auto lambda = []( int a ) -> int
>> 	{
>> 		thread_local int i = 0;
>> 		return i++ + a;
>> 	};
>> 	int (__fastcall *volatile pFnFastcall)( int ) = lambda;
>> 	int (__stdcall *volatile pFnStdcall)( int ) = lambda;
>> 	cout << pFnFastcall( 10 ) << endl;
>> 	cout << pFnStdcall( 9 ) << endl;
>> }
>>
>> Don't compile it yourself,
> 
> An easy injunction to follow since it has syntax errors! ...

The code compiles with MSVC.

[toc] | [prev] | [next] | [standalone]


#92587

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-10-11 12:41 -0700
Message-ID<ug6tpq$20e0f$1@dont-email.me>
In reply to#92575
On 10/11/2023 6:03 AM, Ben Bacarisse wrote:
> Bonita Montero <Bonita.Montero@gmail.com> writes:
> 
>> #include <iostream>
>>
>> using namespace std;
>>
>> int main()
>> {
>> 	auto lambda = []( int a ) -> int
>> 	{
>> 		thread_local int i = 0;
>> 		return i++ + a;
>> 	};
>> 	int (__fastcall *volatile pFnFastcall)( int ) = lambda;
>> 	int (__stdcall *volatile pFnStdcall)( int ) = lambda;
>> 	cout << pFnFastcall( 10 ) << endl;
>> 	cout << pFnStdcall( 9 ) << endl;
>> }
>>
>> Don't compile it yourself,
> 
> An easy injunction to follow since it has syntax errors!  Presumably
> those undeclared identifiers (or proprietary keywords?) have some
> meaning to your compiler.
> 
>> just guess.
> 

Afaict, around 99.(9)% sure, Bonita is a troll.

[toc] | [prev] | [next] | [standalone]


#92588

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-10-11 12:43 -0700
Message-ID<ug6tts$20e0f$2@dont-email.me>
In reply to#92587
On 10/11/2023 12:41 PM, Chris M. Thomasson wrote:
> On 10/11/2023 6:03 AM, Ben Bacarisse wrote:
>> Bonita Montero <Bonita.Montero@gmail.com> writes:
>>
>>> #include <iostream>
>>>
>>> using namespace std;
>>>
>>> int main()
>>> {
>>>     auto lambda = []( int a ) -> int
>>>     {
>>>         thread_local int i = 0;
>>>         return i++ + a;
>>>     };
>>>     int (__fastcall *volatile pFnFastcall)( int ) = lambda;
>>>     int (__stdcall *volatile pFnStdcall)( int ) = lambda;
>>>     cout << pFnFastcall( 10 ) << endl;
>>>     cout << pFnStdcall( 9 ) << endl;
>>> }
>>>
>>> Don't compile it yourself,
>>
>> An easy injunction to follow since it has syntax errors!  Presumably
>> those undeclared identifiers (or proprietary keywords?) have some
>> meaning to your compiler.
>>
>>> just guess.
>>
> 
> Afaict, around 99.(9)% sure, Bonita is a troll.

100% indeed

[toc] | [prev] | [next] | [standalone]


Page 1 of 7  [1] 2 3 4 5 6 7  Next page →

Back to top | Article view | comp.lang.c++


csiph-web