Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: Fwd: [PATCH 01/10] Add the __restrict__ keyword
Date: Thu, 07 Aug 2014 21:02:02 +0100	[thread overview]
Message-ID: <53E3DB3A.5000909@ramsay1.demon.co.uk> (raw)
In-Reply-To: <CANeU7Qn-j4G9Ca=Apa6zX=b07Cba=NuViE0zC3NKpispBOHg9Q@mail.gmail.com>

On 07/08/14 04:04, Christopher Li wrote:
> Send again to the list with plain text mode.
> 
>> No, __restrict__ is only applied to various pointer types in the MinGW
>> header files (see below). So, I agree that validation/reserved.c is not
>> exactly representative of the actual use of __restrict__ (or *any* of the
>> keywords come to that), but that does at least provide a minimal test.
> 
> 
> Let me clarify. I want to have some regression test cover your usage case.
> e.g. If I rewrite some part of sparse and breaks __restrict__ but did not break
> __restrict, I will have not way of knowing it. So please submit corresponding
> test case.

Yep, version 2 of patch coming soon.

> __restrict__ does not seem like part of the stander C. BTW, did you try
> to use gcc -E to find out if __restrict__ expand to any thing like "__restrict"?

Yes, the header is using the keyword __restrict__. (I have found that headers
tend to use __restrict if they are using macros).

>> Having said that, I think I see two tests included for the array declaration
>> usage: abstract-array-declarator-static.c and restrict-array.c.
>>
> I don't see it cover the __restrict__ case as far as I can tell.

Yes, I didn't get that you were talking specifically about __restrict__,
rather than any one of 'restrict', '__restrict' or '__restrict__'.

> Also, do you have run into the case that "__restrict__" was use in abstract
> array? None of your grep example show usage in the array. Your patch seems
> suggest that is possible.

They are very rare in the wild! :-D

The only examples I have come across for real are 'posix_spawn()' (see
<spawn.h>) and 'regexec()' (<regex.h>).

ATB,
Ramsay Jones



  reply	other threads:[~2014-08-07 20:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 18:32 [PATCH 01/10] Add the __restrict__ keyword Ramsay Jones
2014-08-06  9:19 ` Christopher Li
2014-08-06 15:21   ` Ramsay Jones
     [not found]     ` <CANeU7Qm_pUe55OY0+Nh9OS=ZN5NqFytkB3CaJMTZZOvPqtK7nw@mail.gmail.com>
2014-08-07  3:04       ` Fwd: " Christopher Li
2014-08-07 20:02         ` Ramsay Jones [this message]
2014-08-08 11:13           ` Ramsay Jones

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=53E3DB3A.5000909@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1.demon.co.uk \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    /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