diff options
author | Freeyorp <TheFreeYorp+git@gmail.com> | 2024-06-19 12:47:49 +0000 |
---|---|---|
committer | Freeyorp <TheFreeYorp+git@gmail.com> | 2024-06-19 13:00:17 +0000 |
commit | 70ca9f9fa9adb60014e1c7f6e420c327ecd94a39 (patch) | |
tree | f4d4abbb07b0545fbef5927e53122b0b4952884e | |
parent | 053aaa39b0625d374a22191d0468325ebbfa9706 (diff) | |
download | tmwa-70ca9f9fa9adb60014e1c7f6e420c327ecd94a39.tar.gz tmwa-70ca9f9fa9adb60014e1c7f6e420c327ecd94a39.tar.bz2 tmwa-70ca9f9fa9adb60014e1c7f6e420c327ecd94a39.tar.xz tmwa-70ca9f9fa9adb60014e1c7f6e420c327ecd94a39.zip |
strs: Storage class consistency
fwd provides forward declarations of using `class`, but these are defined
in strs.hpp using struct. Only a problem if you both use an explicit `struct`
and use link time optimization - the warning about violating ODR is emitted
during link time with -flto, there is no warning in an isolated compilation
unit.
I do not fully understand why yet.
See the following "never-expire" pastebin of a diff that attempts to create
an upper bound for a a more isolated test case, and fails to trigger the ODR
warning:
https://0bin.net/paste/jDz63gch#DM2x09aMX+iaIAaFWI-WmeSyyKto5F+vZzSniHoHfI6
-rw-r--r-- | src/mmo/fwd.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mmo/fwd.hpp b/src/mmo/fwd.hpp index d98bd33..6a3ece5 100644 --- a/src/mmo/fwd.hpp +++ b/src/mmo/fwd.hpp @@ -46,14 +46,14 @@ class BlockId; class GmLevel; class ClientVersion; -class AccountName; -class AccountPass; -class AccountCrypt; -class AccountEmail; -class ServerName; -class PartyName; +struct AccountName; +struct AccountPass; +struct AccountCrypt; +struct AccountEmail; +struct ServerName; +struct PartyName; +struct VarName; class QuestId; -class VarName; class MapName; class CharName; |