Ticket #41822

chat.cpp compile fail

Open Date: 2021-03-22 10:07 Last Update: 2021-03-29 00:32

Reporter:
(Anonymous)
Owner:
(None)
Type:
Status:
Closed
Component:
(None)
MileStone:
(None)
Priority:
8
Severity:
8
Resolution:
Accepted
File:
2

Details

Fails to compile with either GCC 10 or CLang 11 (Manjaro Linux). CLang has good verbosity so posting that information. Maybe compiles okay in MSVC?

zandronum/src/chat.cpp:168:11: error: no viable conversion from 'FStringCVar' to 'FString'
                FString truncatedPrefix = self;
                        ^                 ~~~~
zandronum/src/./zstring.h:118:2: note: candidate constructor not viable: no known conversion from 'FStringCVar' to 'const FString &' for 1st argument
        FString (const FString &other) { AttachToOther (other); }
        ^
zandronum/src/./zstring.h:119:2: note: candidate constructor not viable: no known conversion from 'FStringCVar' to 'const char *' for 1st argument
        FString (const char *copyStr);
        ^
zandronum/src/./zstring.h:121:2: note: candidate constructor not viable: no known conversion from 'FStringCVar' to 'char' for 1st argument
        FString (char oneChar);
        ^
zandronum/src/./zstring.h:132:2: note: candidate constructor not viable: no known conversion from 'FStringCVar' to 'ELumpNum' for 1st argument
        FString (ELumpNum);     // Create from a lump
        ^
zandronum/src/./c_cvars.h:328:9: note: candidate function
        inline operator const char * () const { return Value; }
               ^
zandronum/src/chat.cpp:181:11: error: no viable conversion from 'FStringCVar' to 'FString'
                FString truncatedSuffix = self;
                        ^                 ~~~~

Ticket History (3/8 Histories)

2021-03-22 10:07 Updated by: None
  • New Ticket "chat.cpp compile fail" created
2021-03-22 11:29 Updated by: akmdm
Comment

I uploaded 10300.patch which should fix the GCC compile error reported above. It probably won't get added into the main repository until next Sunday but feel free to use this for the time being.

(Edited, 2021-03-22 11:30 Updated by: akmdm)
2021-03-23 04:18 Updated by: torr_samaho
Comment

Thanks for the quick patch! It should work, but I think it should be possible to do this in a much simpler manner. Try replacing FString truncatedPrefix = self; with FString truncatedPrefix = self.GetGenericRep(CVAR_String).String;. Same for Suffix.

2021-03-23 07:09 Updated by: akmdm
Comment

You're right. I re-uploaded the patch with your suggestions, it should be a lot simpler now.

2021-03-29 00:32 Updated by: torr_samaho
Comment

I added the updated patch.

2021-03-29 00:32 Updated by: torr_samaho
  • Status Update from Open to Closed
  • Resolution Update from None to Accepted

Attachment File List

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login