[LTP] [PATCH] syscalls/msgstress01: Fix off by one in array access

Cyril Hrubis chrubis@suse.cz
Thu May 23 20:35:20 CEST 2024


Hi!
> And FYI (old, unimportant warning): musl 32bit complains about off_t being long
> long int. Not sure if we bother (after the release) to %lld + cast to (long long int).
> 
> ../../../../../include/tst_safe_macros.h:284:50: warning: format '%ld' expects argument of type 'long int', but argument 11 has type 'off_t' {aka 'long long int'} [-Wformat=]
>   284 |                 "mmap(%p, %zu, %s(%x), %d, %d, %ld)",
>       |                                                ~~^
>       |                                                  |
>       |                                                  long int
>       |                                                %lld

Well, we should print it as lld and cast the off the to (long long int)
to make the code correct on 32bit.

>   285 |                 addr, length, prot_buf, prot, flags, fd, offset);
>       |                                                          ~~~~~~
>       |                                                          |
>       |                                                          off_t {aka long long int}
> 
> Kind regards,
> Petr

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list