public inbox for ltp@lists.linux.it
 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 1/2] Refactoring aio-stress.c using LTP API
Date: Tue, 04 Jan 2022 11:49:00 +0000	[thread overview]
Message-ID: <87a6gbogos.fsf@suse.de> (raw)
In-Reply-To: <YdQGplLdFnsmhlSO@pevik>

Hello Petr,

Petr Vorel <pvorel@suse.cz> writes:

> Hi Andrea,
>
> ...
>>  			for (i = 0; i < io->io_oper->reclen; i++) {
>>  				if (io->buf[i] != verify_buf[i]) {
>> -					fprintf(stderr, "%d:%c:%c ", i,
>> -						io->buf[i], verify_buf[i]);
>> +					ret = asprintf(&msg, "%d:%c:%c ", i, io->buf[i], verify_buf[i]);
>> +					if (ret < 0)
>> +						tst_brk(TBROK, "asprintf memory allocation error");
>> +					ptr += sprintf(ptr, msg);
> Actually, this is problematic for -Werror=format-security which we use in CI.
> Simple "%s" fixes that. It can be done before merge.
>
> ptr += sprintf(ptr, "%s", msg); 
>
> @Richie: I wonder if make check could also actually compile the code with
> extra CFLAGS from build.sh.

Compiling during make-check may confuse things; we don't want make-check
to produce build artifacts. Although I guess you could skip the later
compilation steps. Also then we could add -fanalyzer on gcc which I have
done in a test project[1]. Possibly Clang has something similar,
hhmmmm...

Probably this would require different flags on GCC and Clang. We could
also run both GCC and Clang if they are present. It's probably worth
experimenting with.

[1]: https://richiejp.com/zc-data#meson

-- 
Thank you,
Richard.

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

  reply	other threads:[~2022-01-04 11:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04  7:37 [LTP] [PATCH v2 0/2] aio-stress.c refactoring Andrea Cervesato via ltp
2022-01-04  7:37 ` [LTP] [PATCH v2 1/2] Refactoring aio-stress.c using LTP API Andrea Cervesato via ltp
2022-01-04  8:27   ` Petr Vorel
2022-01-04  8:34   ` Petr Vorel
2022-01-04 11:49     ` Richard Palethorpe [this message]
2022-01-04 12:22       ` Petr Vorel
2022-01-04  7:37 ` [LTP] [PATCH v2 2/2] Update ltp-aio-stress suites using new options Andrea Cervesato via ltp
2022-01-04  8:35   ` Petr Vorel

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=87a6gbogos.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox