Commit fca0e40
committed
deps/switchres: fix -Wformat warnings on 32-bit builds
Three -Wformat= warnings surface on i386 Linux where size_t is unsigned
int and uint64_t is unsigned long long (both differ from x86_64, where
the existing specifiers happen to match):
display_linux.cpp:166 %ld on vector::size_type (size_t)
custom_video_xrandr.cpp:679 %lx on uint64_t platform_data
custom_video_xrandr.cpp:685 %lx on uint64_t platform_data
The size_t case is signedness-only and benign in practice; switch to
%zu, the C99 specifier intended for size_t. The uint64_t cases are an
actual 32-bit truncation bug -- %lx reads four bytes off the stack on
i386 cdecl, dropping the high 32 bits of platform_data and misaligning
any following format arguments. Use %llx with an explicit
(unsigned long long) cast, matching the raw-printf idiom Switchres
uses everywhere else (no <inttypes.h> / PRIx64 elsewhere in the tree).
deps/switchres/ is a verbatim mirror of antonioginer/switchres; this
fix should also be sent upstream so the next sync doesn't reintroduce
the warnings.1 parent 07b6551 commit fca0e40
2 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
679 | | - | |
| 679 | + | |
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
685 | | - | |
| 685 | + | |
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
0 commit comments