Failed to compile nsEdgeReadingListExtractor.cpp: error C2664: cannot convert argument from 'char16_t *' to 'JET_PCWSTR'

RESOLVED FIXED in Firefox 43

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: JanH, Assigned: jaws)

Tracking

Trunk
Firefox 43
x86_64
Windows 7
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox43 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Trying to build Firefox on Windows 7 and VS2015 with "--enable-debug --disable-optimize" fails with this error:

> 23:40.36 nsEdgeReadingListExtractor.cpp
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(57): error C2664: "JET_ERR JetGetDatabaseFileInfoW(JET_PCWSTR,void *,unsigned long,unsigned long)" : Konvertierung von Argument 1 von "char16_t *" in "JET_PCWSTR" nicht möglich
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(57): note: Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(80): error C2664: "JET_ERR JetAttachDatabaseW(JET_SESID,JET_PCWSTR,JET_GRBIT)" : Konvertierung von Argument 2 von "char16_t *" in "JET_PCWSTR" nicht möglich
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(80): note: Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(83): error C2664: "JET_ERR JetOpenDatabaseW(JET_SESID,JET_PCWSTR,JET_PCWSTR,JET_DBID *,JET_GRBIT)" : Konvertierung von Argument 2 von "char16_t *" in "JET_PCWSTR" nicht möglich
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(83): note: Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.

Two days ago, before the patch for bug 1193387 was merged into mozilla-central, I was able to build successfully.
Change line 53 from
> char16_t* dbPath = ToNewUnicode(aDBPath);
to
> char16ptr_t dbPath = ToNewUnicode(aDBPath);
should fix this issue.
(Reporter)

Comment 2

3 years ago
Yes, build ran successfully with that change, thanks.
Created attachment 8654902 [details] [diff] [review]
Patch
Assignee: nobody → jaws
Status: NEW → ASSIGNED
Attachment #8654902 - Flags: review?(jmathies)
Component: Build Config → Migration
Product: Core → Firefox

Comment 4

3 years ago
Comment on attachment 8654902 [details] [diff] [review]
Patch

Review of attachment 8654902 [details] [diff] [review]:
-----------------------------------------------------------------

Aren't you leaking this string? ToNewUnicode calls NS_StringCloneData which allocated a new buffer, but I don't see where that gets freed in this code. The buffer should land in something that frees it when it falls out of scope.
Attachment #8654902 - Flags: review?(jmathies) → review-
(In reply to Jim Mathies [:jimm] from comment #4)
> Aren't you leaking this string? ToNewUnicode calls NS_StringCloneData which
> allocated a new buffer, but I don't see where that gets freed in this code.
> The buffer should land in something that frees it when it falls out of scope.

Isn't that a bug from bug 1193387? I don't think that should be a blocker for this bug...

Comment 6

3 years ago
Comment on attachment 8654902 [details] [diff] [review]
Patch

Yeah you're right, I was just being lazy. Filed bug 1200656.
Attachment #8654902 - Flags: review- → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/395305136abd
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox43: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
You need to log in before you can comment on or make changes to this bug.