#25314 closed defect (fixed)

Build error during Windows (32- and 64-bit builds) of Thunderbird

Reported by: sukhbir Owned by:
Priority: Medium Milestone:
Component: Archived/Tor Mail Version:
Severity: Normal Keywords:
Cc: boklm, arlolra Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When building Thunderbird for Windows (32- and 64-bit builds), we get the following error:

20:38.34 /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp: In static member function 'static nsresult nsMsgSearchOnlineMail::Encode(nsCString&, nsISupportsArray*, const char16_t*)':
20:38.34 /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp:122:43: error: call of overloaded 'NS_IsAscii(char16ptr_t)' is ambiguous
20:38.34          asciiOnly = NS_IsAscii(pchar.get());
20:38.34                                            ^
20:38.34 In file included from /var/tmp/build/thunderbird-48f960ae7db5/obj-mingw/dist/include/msgCore.h:15:0,
20:38.35                  from /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp:5:
20:38.35 /var/tmp/build/thunderbird-48f960ae7db5/obj-mingw/dist/include/nsCRTGlue.h:101:6: note: candidate: bool NS_IsAscii(char16_t)
20:38.35  bool NS_IsAscii(char16_t aChar);
20:38.35       ^
20:38.35 /var/tmp/build/thunderbird-48f960ae7db5/obj-mingw/dist/include/nsCRTGlue.h:102:6: note: candidate: bool NS_IsAscii(const char16_t*)
20:38.35  bool NS_IsAscii(const char16_t* aString);
20:38.35       ^
20:38.35 /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp:131:48: error: operands to ?: have different types 'char16ptr_t' and 'const char16_t*'
20:38.35    char *csname = GetImapCharsetParam(asciiOnly ? usAsciiCharSet.get() : destCharset);
20:38.35                                                 ^
20:38.35 /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp:131:48: note:   and each type can be converted to the other
20:38.35 /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp:136:15: error: operands to ?: have different types 'char16ptr_t' and 'const char16_t*'
20:38.35      asciiOnly ?  usAsciiCharSet.get(): destCharset,
20:38.35                ^
20:38.35 /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp:136:15: note:   and each type can be converted to the other
20:38.35 /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp:137:15: error: operands to ?: have different types 'char16ptr_t' and 'const char16_t*'
20:38.35      asciiOnly ?  usAsciiCharSet.get(): destCharset, false);
20:38.35                ^
20:38.35 /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp:137:15: note:   and each type can be converted to the other
20:38.40 
20:38.40 In the directory  /var/tmp/build/thunderbird-48f960ae7db5/obj-mingw/mailnews/base/search/src
20:38.40 The following command failed to execute properly:
20:38.40 /var/tmp/dist/mingw-w64/helpers/x86_64-w64-mingw32-g++ -std=gnu++11 -mwindows -o nsMsgImapSearch.o -c -DNDEBUG=1 -DTRIMMED=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src -I/var/tmp/build/thunderbird-48f960ae7db5/obj-mingw/mailnews/base/search/src -I/var/tmp/build/thunderbird-48f960ae7db5/obj-mingw/dist/include -I/var/tmp/build/thunderbird-48f960ae7db5/obj-mingw/dist/include/nspr -I/var/tmp/build/thunderbird-48f960ae7db5/obj-mingw/dist/include/nss -DMOZILLA_CLIENT -include /var/tmp/build/thunderbird-48f960ae7db5/obj-mingw/mozilla-config.h -MD -MP -MF .deps/nsMsgImapSearch.o.pp -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-format -fno-lifetime-dse -fno-exceptions -fno-strict-aliasing -mms-bitfields -fno-rtti -fno-exceptions -fno-math-errno -pipe -g -O -fomit-frame-pointer /var/tmp/build/thunderbird-48f960ae7db5/mailnews/base/search/src/nsMsgImapSearch.cpp
20:38.40 /var/tmp/build/thunderbird-48f960ae7db5/mozilla/config/rules.mk:951: recipe for target 'nsMsgImapSearch.o' failed
20:38.40 make[4]: *** [nsMsgImapSearch.o] Error 1
20:38.40 /var/tmp/build/thunderbird-48f960ae7db5/mozilla/config/recurse.mk:71: recipe for target 'mailnews/base/search/src/target' failed
20:38.40 make[3]: *** [mailnews/base/search/src/target] Error 2
20:38.40 make[3]: *** Waiting for unfinished jobs....
20:46.65 libmsgbsutl_s.a.desc
20:46.71 /var/tmp/build/thunderbird-48f960ae7db5/mozilla/config/recurse.mk:32: recipe for target 'compile' failed
20:46.71 make[2]: *** [compile] Error 2
20:46.71 /var/tmp/build/thunderbird-48f960ae7db5/mozilla/config/rules.mk:523: recipe for target 'default' failed
20:46.71 make[1]: *** [default] Error 2
20:46.71 client.mk:397: recipe for target 'build' failed
20:46.71 make: *** [build] Error 2

Child Tickets

Change History (3)

comment:2 Changed 14 months ago by sukhbir

Patch; I am keeping it separate for now but since I will submit this upstream as well, I will combine it later.

In comm-esr52:

diff --git a/mailnews/base/search/src/nsMsgImapSearch.cpp b/mailnews/base/search/src/nsMsgImapSearch.cpp
--- a/mailnews/base/search/src/nsMsgImapSearch.cpp
+++ b/mailnews/base/search/src/nsMsgImapSearch.cpp
@@ -84,7 +84,7 @@
 
 nsresult nsMsgSearchOnlineMail::Encode (nsCString& pEncoding,
                                         nsISupportsArray *searchTerms,
-                                        const char16_t *destCharset)
+                                        char16ptr_t destCharset)
 {
   nsCString imapTerms;
   
diff --git a/mailnews/base/search/src/nsMsgSearchImap.h b/mailnews/base/search/src/nsMsgSearchImap.h
--- a/mailnews/base/search/src/nsMsgSearchImap.h
+++ b/mailnews/base/search/src/nsMsgSearchImap.h
@@ -24,7 +24,7 @@
 
   static nsresult Encode (nsCString& ppEncoding,
                             nsISupportsArray *searchTerms,
-                            const char16_t *destCharset);
+                            char16ptr_t destCharset);
 
 
 protected:

And in mozilla/ (tor-browser-52.6.0esr-7.5-2-build1):

diff --git a/xpcom/glue/nsCRTGlue.h b/xpcom/glue/nsCRTGlue.h
index 8caa1ae2727a..d80398a794c3 100644
--- a/xpcom/glue/nsCRTGlue.h
+++ b/xpcom/glue/nsCRTGlue.h
@@ -100,6 +100,11 @@ bool NS_IsLower(char aChar);
 
 bool NS_IsAscii(char16_t aChar);
 bool NS_IsAscii(const char16_t* aString);
+#ifdef MOZ_USE_CHAR16_WRAPPER
+bool NS_IsAscii(char16ptr_t aString) {
+       return NS_IsAscii(static_cast<const char16_t*>(aString));
+}
+#endif
 bool NS_IsAsciiAlpha(char16_t aChar);
 bool NS_IsAsciiDigit(char16_t aChar);
 bool NS_IsAsciiWhitespace(char16_t aChar);

comment:3 Changed 14 months ago by sukhbir

Resolution: fixed
Status: newclosed

Patch submitted and merged upstream in https://bugzilla.mozilla.org/show_bug.cgi?id=1442648

Note: See TracTickets for help on using tickets.