Opened 4 years ago

Closed 4 years ago

#5646 closed defect (fixed)

format.h is bugged

Reported by: Silier Owned by: adrian
Priority: Must Have Milestone: Alpha 24
Component: Build & Packages Keywords:
Cc: Patch: Phab:D2613

Description (last modified by Silier)

fmt::internal::CharTraits<char>::convert': cannot access private member declared

that basically means one cannot use wstring and pass it to LOGWARNING or similar calls, where conversion is needed.

Issue have been fixed, but we have outdated version: https://github.com/fmtlib/fmt/issues/117 File itself is available here: https://github.com/fmtlib/fmt/blob/master/include/fmt/format.h

One cannot simply download and replace the file, because there have been done modifications to our version of file, so they need to be done in new version of file too.

Code to reproduce:

LOGWARNING("Passed wrong value %ls", L"wstring");

Change History (10)

comment:1 by adrian, 4 years ago

Owner: set to adrian
Status: newassigned

comment:2 by adrian, 4 years ago

@Angen could you say how to reproduce this bug?

I put LOGWARNING(L"warning") and LOGWARNING(std::wstring("warning")) in some file and I received completely different compiler errors like followings:

error: no matching function for call to ‘sprintf(const wchar_t [36])’
error: no matching function for call to ‘std::__cxx11::basic_string<wchar_t>::basic_string(const char [11])’

comment:3 by Silier, 4 years ago

Description: modified (diff)

in reply to:  2 comment:4 by Silier, 4 years ago

Replying to adrian:

@Angen could you say how to reproduce this bug?

Sorry it took me so long, I have updated ticket with example.

comment:5 by Silier, 4 years ago

Description: modified (diff)

comment:6 by adrian, 4 years ago

@Angen I updated fmt, preserving previous changes. Everything is compiling, tests are passing. What is the next step? This will be my first commit to the 0ad codebase :)

comment:7 by Silier, 4 years ago

Thank you for working on this :) You would need to create an account here https://code.wildfiregames.com/ and upload there your diff.

For more detailed steps take a look here: https://trac.wildfiregames.com/wiki/SubmittingPatches https://trac.wildfiregames.com/wiki/Phabricator

also do not forget to add yourself to the credits: binaries/data/mods/public/gui/credits/texts/programming.json

comment:8 by adrian, 4 years ago

Added diff for a review Phab:D2613

comment:9 by Itms, 4 years ago

Patch: Phab:D2613

Thanks for the patch! This is related to tickets #3190 and #4148.

comment:10 by Itms, 4 years ago

Resolution: fixed
Status: assignedclosed

In 23562:

Update cppformat from v0.11.0 to v1.1.0, fixes #5646, refs #3190.
Use the opportunity to rename the lib from cppformat to fmt, refs #4148.

Patch By: adrian
Rebased By: s0600204
Differential Revision: https://code.wildfiregames.com/D2613

Note: See TracTickets for help on using tickets.