From 70ca9f9fa9adb60014e1c7f6e420c327ecd94a39 Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Wed, 19 Jun 2024 12:47:49 +0000 Subject: 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 --- src/mmo/fwd.hpp | 14 +++++++------- 1 file 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; -- cgit v1.2.3-70-g09d2