Fix compile errors in Windows-only code after official builds switched to clang-cl in bug 1443590

RESOLVED FIXED in Thunderbird 63.0

Status

defect
RESOLVED FIXED
Last year
9 months ago

People

(Reporter: jorgk, Assigned: jorgk)

Tracking

Trunk
Thunderbird 63.0

Thunderbird Tracking Flags

(thunderbird_esr6063+ fixed, thunderbird63 fixed)

Details

Attachments

(1 attachment)

There are compile errors in nsMessengerWinIntegration and nsAbOutlookDirectory (at least):

https://taskcluster-artifacts.net/WbGWHoDqQrSp25rIlJ1zXA/0/public/logs/live_backing.log

nsMessengerWinIntegration.cpp(289,35):  error: non-constant-expression cannot be narrowed from type 'LONG' (aka 'long') to 'DWORD' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]

nsAbOutlookDirectory.cpp(63,39):  error: cannot pass object of non-trivial type 'nsCString' (aka 'nsTString<char>') through variadic function; call will abort at runtime [-Wnon-pod-varargs]
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=623e5cfcc5de2930d01cec0cfd94d820bfa11be9

I can't tell whether this is right since vs2017 will compile just about anything ;-)
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Looks like those two got fixed, but there are now some more :-(

nsWMSettings.cpp(697,55):  error: cannot pass object of non-trivial type 'nsAutoString' (aka 'nsTAutoStringN<char16_t, 64>') through variadic function; call will abort at runtime [-Wnon-pod-varargs]

nsWMSettings.cpp(737,54):  error: cannot pass object of non-trivial type 'nsAutoString' (aka 'nsTAutoStringN<char16_t, 64>') through variadic function; call will abort at runtime [-Wnon-pod-varargs]

rtfDecoder.cpp(467,9):  error: no matching constructor for initialization of 'Lexem'

Another try:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=a88765b2dbf87593beba0d1440aed1fc4a0db9e3

We could be here for a while.
More errors:
rtfDecoder.cpp(468,9):  error: no viable overloaded '='
rtfDecoder.cpp(472,9):  error: no viable overloaded '='
rtfDecoder.cpp(482,11):  error: no viable overloaded '='

Let's see whether this fixed it:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=ae9fa3c25a7a58cf0b11f152253444e00cfae676
The rtfDecoder.cpp is horrible. The assignment actually modifies the RHS :-(
https://dxr.mozilla.org/comm-central/rev/49a49e3bd9e5578c6744dacf372eb902746df6e6/mailnews/import/outlook/src/rtfDecoder.cpp#184

So the input value can't be 'const' and consequently something like
  lexem = GetLexem(...);
fails since it would modify the function's return value on the heap. Yuk. As far as I can see, the function doesn't actually return the "bdata type which is modified when assigning, so there was never a problem at runtime. Hmm.

Since I didn't want to drill open the entire box, I modified GetLexem().

Let's see:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=985b77318b29f4e8850829a1941aae8af4ea5fff
Judging by the time this has been compiling, we got past all the errors.
Attachment #8991465 - Flags: review?(acelists)
Well, that wasn't 100% right. The assignment operator is
  Lexem& operator = (Lexem& from)
And that expects an l-value, and not a function invocation, like GetLexem(...).
Comment on attachment 8991465 [details] [diff] [review]
1474878-compile-errors.patch

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

Thanks.
Attachment #8991465 - Flags: review?(acelists) → review+
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/e7988ebfa0a8
fix compile errors found by clang-cl in Windows-only code. r=aceman
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 63.0
Version: 60 → Trunk
Comment on attachment 8991465 [details] [diff] [review]
1474878-compile-errors.patch

Let's consider this for uplift one day.
Attachment #8991465 - Flags: approval-comm-esr60?
Attachment #8991465 - Flags: approval-comm-esr60? → approval-comm-esr60+
You need to log in before you can comment on or make changes to this bug.