Closed Bug 391577 Opened 18 years ago Closed 18 years ago

fprintf bug in AvmDebugUnix.cpp

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jorendorff, Assigned: jorendorff)

Details

Attachments

(1 file, 1 obsolete file)

gcc warns about it: src/tamarin/tamarin-central/core/AvmDebugUnix.cpp: In function 'void avmplus::AvmDebugMsg(const avmplus::wchar*, bool)': src/tamarin/tamarin-central/core/AvmDebugUnix.cpp:67: warning: format '%s' expects type 'char*', but argument 3 has type 'const avmplus::wchar*' I think gcc is right, "%s" should be "%ls" on that line. (On Mac OS, at least, this breaks the xp build, which uses -Werror.)
I don't think %ls is portable; you may just want to either convert to UTF8, or, if this is just debugging code, just chop the high byte and convert to ascii.
It might be worth changing it to %ls, checking that in, and then leaving this bug open (or filing a new one) because of the portability problem. Being able to build is good. :)
Attached patch v1 (obsolete) — Splinter Review
Now I get this on the Mac as well. The build is broken in actionmonkey branch because of this bug. avmplus::wchar is not wchar_t, so %ls doesn't work. So the patch converts to UTF-8 using UnicodeUtils. There were Windows newlines in the file; this removes them.
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
Attachment #278196 - Flags: review?
Severity: normal → major
Attachment #278196 - Flags: review? → review?(dansmith)
r+ to this change.
Here's the version I'm checking in. v1 didn't check for "new uint8[]" returning NULL, so I added that.
Attachment #278196 - Attachment is obsolete: true
Attachment #278196 - Flags: review?(dansmith)
Attachment #278414 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Transfer Bug from Core->Tamarin to Tamarin Product.
Component: Tamarin → Virtual Machine
Product: Core → Tamarin
Version: Other Branch → unspecified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: