All of lore.kernel.org
 help / color / mirror / Atom feed
From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: "rpalethorpe@suse.de" <rpalethorpe@suse.de>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [COMMITTED] save_restore: remove the duplicate 'const' declaration
Date: Fri, 11 Mar 2022 01:18:00 +0000	[thread overview]
Message-ID: <622AA37C.6000108@fujitsu.com> (raw)
In-Reply-To: <87tuc6knks.fsf@suse.de>

Hi Richard
> 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.
Sound reasonable.

Best Regards
Yang Xu
> 
>>
>> Best Regards
>> Yang Xu
>>>
>>> Best Regards
>>> Yang Xu
>>>
> 
> 

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

      reply	other threads:[~2022-03-11  1:18 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
2022-03-11  1:18       ` xuyang2018.jy [this message]

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=622AA37C.6000108@fujitsu.com \
    --to=xuyang2018.jy@fujitsu.com \
    --cc=ltp@lists.linux.it \
    --cc=rpalethorpe@suse.de \
    /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.