From: Richard Palethorpe <rpalethorpe@suse.de>
To: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [COMMITTED] save_restore: remove the duplicate 'const' declaration
Date: Thu, 10 Mar 2022 12:09:08 +0000 [thread overview]
Message-ID: <87tuc6knks.fsf@suse.de> (raw)
In-Reply-To: <6229BFAD.1060504@fujitsu.com>
Hello,
"xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com> writes:
> Hi Richard
>> Hi Li
>>> --- a/lib/newlib_tests/test19.c
>>> +++ b/lib/newlib_tests/test19.c
>>> @@ -23,7 +23,7 @@ static struct tst_test test = {
>>> .needs_root = 1,
>>> .test_all = run,
>>> .setup = setup,
>>> - .save_restore = (const struct tst_path_val const[]) {
>>> + .save_restore = (const struct tst_path_val[]) {
>>> {"?/proc/nonexistent", NULL},
>>> {"!/proc/sys/kernel/numa_balancing", NULL},
>>> {"/proc/sys/kernel/core_pattern", NULL},
>>
>> Since tst_path_val is a struct array, we should use {NULL, NULL} or {}
>> terminated instead of NULL terminated , otherwise it will report missing
>> braces warning.
> Since we have the following rule
> LTP-005 Array must terminate with a sentinel value (i.e. NULL or '{}')
>
> Can we check struct array whether use {} terminated instead of NULL?
I think so, however naively enabling the check causes a segfault in
ptr_list_empty. Probably because there is no list, it's just NULL.
It already reports the missing braces, but I suppose this is not very
helpful.
>
> Best Regards
> Yang Xu
>>
>> Best Regards
>> Yang Xu
>>
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-03-10 12:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 8:22 [LTP] [COMMITTED] save_restore: remove the duplicate 'const' declaration Li Wang
2022-03-10 8:38 ` xuyang2018.jy
2022-03-10 8:45 ` Li Wang
2022-03-10 8:53 ` xuyang2018.jy
2022-03-10 8:58 ` Li Wang
2022-03-10 9:06 ` xuyang2018.jy
2022-03-10 12:09 ` Richard Palethorpe [this message]
2022-03-11 1:18 ` xuyang2018.jy
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=87tuc6knks.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=ltp@lists.linux.it \
--cc=xuyang2018.jy@fujitsu.com \
/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