Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] But wait, if I created an init function in each TU and inside the constructors of the register test

[DiscordArchive] But wait, if I created an init function in each TU and inside the constructors of the register test

[DiscordArchive] But wait, if I created an init function in each TU and inside the constructors of the register test

rektbyfaith
Administrator
0
09-11-2022, 05:40 PM
#1
Archived author: Sovak • Posted: 2022-09-11T17:40:01.439000+00:00
Original source

But wait, if I created an init function in each TU and inside the constructors of the register test global variables id create a side effect that would affect the init function, wouldnt the global variables be forced to be linked in? <@200677690838220800> Or would that be implementation dependent behavior?
rektbyfaith
09-11-2022, 05:40 PM #1

Archived author: Sovak • Posted: 2022-09-11T17:40:01.439000+00:00
Original source

But wait, if I created an init function in each TU and inside the constructors of the register test global variables id create a side effect that would affect the init function, wouldnt the global variables be forced to be linked in? <@200677690838220800> Or would that be implementation dependent behavior?

rektbyfaith
Administrator
0
09-11-2022, 05:40 PM
#2
Archived author: <o> • Posted: 2022-09-11T17:40:59.819000+00:00
Original source

it's ub and the variables aren't guaranteed to even load before you access them
rektbyfaith
09-11-2022, 05:40 PM #2

Archived author: <o> • Posted: 2022-09-11T17:40:59.819000+00:00
Original source

it's ub and the variables aren't guaranteed to even load before you access them

rektbyfaith
Administrator
0
09-11-2022, 05:41 PM
#3
Archived author: Sovak • Posted: 2022-09-11T17:41:23.002000+00:00
Original source

id access the init function at runtime
rektbyfaith
09-11-2022, 05:41 PM #3

Archived author: Sovak • Posted: 2022-09-11T17:41:23.002000+00:00
Original source

id access the init function at runtime

rektbyfaith
Administrator
0
09-11-2022, 05:41 PM
#4
Archived author: Sovak • Posted: 2022-09-11T17:41:37.306000+00:00
Original source

for example std::vector<bool> loaded.
rektbyfaith
09-11-2022, 05:41 PM #4

Archived author: Sovak • Posted: 2022-09-11T17:41:37.306000+00:00
Original source

for example std::vector<bool> loaded.

rektbyfaith
Administrator
0
09-11-2022, 05:42 PM
#5
Archived author: Sovak • Posted: 2022-09-11T17:42:06.811000+00:00
Original source

ctor: { loaded.push_back(loadtest(suite, name)) }
rektbyfaith
09-11-2022, 05:42 PM #5

Archived author: Sovak • Posted: 2022-09-11T17:42:06.811000+00:00
Original source

ctor: { loaded.push_back(loadtest(suite, name)) }

rektbyfaith
Administrator
0
09-11-2022, 05:42 PM
#6
Archived author: Sovak • Posted: 2022-09-11T17:42:21.315000+00:00
Original source

and then in the init function access loaded vector somehow
rektbyfaith
09-11-2022, 05:42 PM #6

Archived author: Sovak • Posted: 2022-09-11T17:42:21.315000+00:00
Original source

and then in the init function access loaded vector somehow

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)