Closed Bug 1661363 Opened 4 years ago Closed 4 years ago

Clang-11 enforces -Wpointer-to-int-cast

Categories

(Thunderbird :: Build Config, defect)

Thunderbird 82
x86_64
Windows
defect

Tracking

(thunderbird_esr78 unaffected)

RESOLVED FIXED
82 Branch
Tracking Status
thunderbird_esr78 --- unaffected

People

(Reporter: rjl, Assigned: darktrojan)

References

Details

Attachments

(1 file)

-Wpointer-to-int-cast appears to be a new warning/error that is enabled by default in Clang 11. Per the docs, it existed previously for gcc compatibility but had no effect.

It breaks Windows builds though:

/builds/worker/fetches/clang/bin/clang-cl -Xclang -std=c++17 -FonsMessengerWinIntegration.obj -c  -I/builds/worker/workspace/obj-build/dist/stl_wrappers -guard:cf -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -D_SECURE_ATL -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DOS_WIN=1 -DWIN32 -D_WIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN -DCOMPILER_MSVC -DWINAPI_NO_BUNDLED_LIBRARIES -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/comm/mailnews/base/src -I/builds/worker/workspace/obj-build/comm/mailnews/base/src -I/builds/worker/checkouts/gecko/dom/base -I/builds/worker/checkouts/gecko/netwerk/base -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/ipc/glue -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -MD -FI /builds/worker/workspace/obj-build/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -Qunused-arguments -fcrash-diagnostics-dir=/builds/worker/artifacts -TP -Zc:sizedDealloc- -D_HAS_EXCEPTIONS=0 -W3 -Gy -Zc:inline -Gw -Wno-inline-new-delete -Wno-invalid-offsetof -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-microsoft-exception-spec -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Z7 -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -Werror -Xclang -fexperimental-new-pass-manager  -Xclang -MP -Xclang -dependency-file -Xclang .deps/nsMessengerWinIntegration.obj.pp -Xclang -MT -Xclang nsMessengerWinIntegration.obj   /builds/worker/checkouts/gecko/comm/mailnews/base/src/nsMessengerWinIntegration.cpp
/builds/worker/checkouts/gecko/comm/mailnews/base/src/nsMessengerWinIntegration.cpp(1123,45): error: cast to smaller integer type 'unsigned short' from 'wchar_t *' [-Werror,-Wpointer-to-int-cast]

Which is part of the minimize to tray code...
https://searchfox.org/comm-central/source/mailnews/base/src/nsMessengerWinIntegration.cpp#1107-1123

Assignee: nobody → geoff
Status: NEW → ASSIGNED

Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/77f1985bf211
Fix -Wpointer-to-int-cast warning. r=rjl

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/42c1bdfcf3fc
followup - clang-format. rs=clang-format
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: