mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
The `offset` argument to `mmap()` was computed with a direct cast from
pointer to `off_t`:
`(off_t)addr_hint - (off_t)map_base`
This causes a build failure when compiling since pointers and `off_t`
may differ in size on some platforms.
maps12.c: In function 'mmap_pages':
maps12.c:114:50: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
114 | filemap ? fd : -1, filemap ? ((off_t)addr_hint - (off_t)map_base) : 0);
| ^
maps12.c:114:69: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
114 | filemap ? fd : -1, filemap ? ((off_t)addr_hint - (off_t)map_base) : 0);
The fix in this patch is to cast both pointers to `intptr_t`,
perform the subtraction in that type, and then cast the result
back to `off_t`.
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
|
||
|---|---|---|
| .. | ||
| compel | ||
| cuda-checkpoint | ||
| exhaustive | ||
| inhfd | ||
| javaTests | ||
| jenkins | ||
| libfault | ||
| others | ||
| pki | ||
| plugins | ||
| zdtm | ||
| .gitignore | ||
| abrt.sh | ||
| check_actions.py | ||
| crit-recode.py | ||
| empty-netns-prep.sh | ||
| groups.desc | ||
| inhfd.desc | ||
| Makefile | ||
| pycriu | ||
| show_action.sh | ||
| umount2.c | ||
| zdtm.desc | ||
| zdtm.py | ||
| zdtm_ct.c | ||
| zdtm_mount_cgroups | ||
| zdtm_umount_cgroups | ||