All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] syscalls/brk: add direct syscall tst_variant
Date: Tue, 13 Dec 2022 09:34:20 +0000	[thread overview]
Message-ID: <87fsdjskzw.fsf@suse.de> (raw)
In-Reply-To: <Y5eA7WeAV4b/Cp8d@pevik>

Hello,

Petr Vorel <pvorel@suse.cz> writes:

> Hi Teo,
>
>> Hi Petr,
>
>> On 12/12/2022 15:22, Petr Vorel wrote:
>> > Hi Richie,
>
>> > > Cyril, Petr, Would you like to add your reviewed by tags? Then we can
>> > > merge this.
>> > By accident I reply to my points to v1 [1].
>> > To copy it here:
>
>> > 1) There are warnings:
>> > brk02.c: In function ‘brk_variants’:
>> > brk02.c:26:28: warning: cast to pointer from integer of different size
>> > [-Wint-to-pointer-cast]
>> >     26 |                 brk_addr = (void *)brk(addr);
>> >           |                            ^
>
>> > 2) make check reports errors which are easily fixed.
>
>> > Teo replied [2], that he's going to fix it. I thought I had set it
>> > "Changes requested", but now I see "Needs Review / ACK". Setting it to
>> > "Changes requested".
>
>> I believe the points you raised are fixed in the v2, on top of this thread.
>> Re-applying it on top of master on my side doesn't give me any warnings for
>> the brk tests, as I do not cast the result from the libc brk anymore, and
>> make check reports existing issues with the name of the function, but no
>> style problems that did exist in v1. (I don't mind changing them if you
>> want, but they are present on master as well).
>
>> If you give a quick look at the patch v2 you'll see that indeed there is no
>> more (void *)brk(addr) or such that generated the warnings, for example.
>> (The syscalls still need it, as they return the break directly rather than
>> an error, which is what the libc wrapper does.)
>
>> I might be missing something, please do tell me if that's the case ! But I
>> believe that the v2 _should_ be free of those issues.
>
> I thought I must have put v1 code into my v2 branch. But the warnings are
> actually when compiling on Alpine:
>
> $ make V=1
> gcc -I../../../../include -I../../../../include
> -I../../../../include/old/ -g -O2 -g -O2 -fno-strict-aliasing -pipe
> -Wall -W -Wold-style-definition -L../../../../lib brk01.c -lltp -o
> brk01
> brk01.c: In function 'verify_brk':
> brk01.c:22:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>    22 |                 cur_brk = (void *)tst_syscall(__NR_brk, 0);
>       |                           ^
> brk01.c:52:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>    52 |                         cur_brk = (void *)tst_syscall(__NR_brk, new_brk);
>       |                                   ^
> gcc -I../../../../include -I../../../../include
> -I../../../../include/old/ -g -O2 -g -O2 -fno-strict-aliasing -pipe
> -Wall -W -Wold-style-definition -L../../../../lib brk02.c -lltp -o
> brk02
> brk02.c: In function 'brk_variants':
> brk02.c:24:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>    24 |                 brk_addr = (void *)tst_syscall(__NR_brk, addr);
>       |                            ^
> brk02.c: In function 'brk_down_vmas':
> brk02.c:38:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>    38 |                 brk_addr = (void *)tst_syscall(__NR_brk, 0);
>       |                            ^
>

How is this possible when tst_syscall (now) uses intptr_t?

-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-12-13  9:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07  9:24 [LTP] [PATCH v2] syscalls/brk: add direct syscall tst_variant Teo Couprie Diaz
2022-12-12 15:12 ` Richard Palethorpe
2022-12-12 15:22   ` Petr Vorel
2022-12-12 18:28     ` Teo Couprie Diaz
2022-12-12 19:28       ` Petr Vorel
2022-12-13  9:34         ` Richard Palethorpe [this message]
2022-12-13 11:48         ` Teo Couprie Diaz
2022-12-13 19:00           ` Petr Vorel
2022-12-14 10:03             ` Teo Couprie Diaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsdjskzw.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.