linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: Derek M Jones <derek@knosof.co.uk>
Cc: Dibyendu Majumdar <mobile@majumdar.org.uk>,
	Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: Sparse parsing question: string literal
Date: Sun, 20 Aug 2017 12:00:09 -0400	[thread overview]
Message-ID: <CANeU7QmGO7BCDFYhsBmpipB4TYPXWybd9txDOq9Fkw91HKHtug@mail.gmail.com> (raw)
In-Reply-To: <ccf4cac2-003f-f856-28db-49dacae374b6@knosof.co.uk>

On Sun, Aug 20, 2017 at 11:16 AM, Derek M Jones <derek@knosof.co.uk> wrote:
>
> You forgot the static keyword:
> Sentence 903:
> http://c0x.coding-guidelines.com/6.4.5.html

Thanks for catching that. You are right. They need to be static as well.
I kind of expect that to be const as well. The stander did not put const
as requirement. Just said modify the string is undefined.

>
> But depending on context a conversion occurs.
> Sentence 729:
> http://c0x.coding-guidelines.com/6.3.2.1.html
>
> and your example is one where such a conversion occurs.

Thanks for pointing it out. Interesting read.

BTW, unrelated to string literal but relate to 729.

Do you have any comment on sparse giving warning of:
sizeof(function_name)?

The programmer usually mean sizeof(&function_name).
But 729 said sizeof is such a special case the function degenerate
into pointers does not work inside sizeof().

Should sparse give warning for sizeof(function_name) at all?

Thanks

Chris

  reply	other threads:[~2017-08-20 16:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-20 12:31 Sparse parsing question: string literal Dibyendu Majumdar
2017-08-20 13:05 ` Christopher Li
2017-08-20 13:12   ` Dibyendu Majumdar
2017-08-20 13:31     ` Christopher Li
2017-08-20 15:16   ` Derek M Jones
2017-08-20 16:00     ` Christopher Li [this message]
2017-08-20 16:31       ` Derek M Jones
2017-08-20 18:25         ` Christopher Li

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=CANeU7QmGO7BCDFYhsBmpipB4TYPXWybd9txDOq9Fkw91HKHtug@mail.gmail.com \
    --to=sparse@chrisli.org \
    --cc=derek@knosof.co.uk \
    --cc=linux-sparse@vger.kernel.org \
    --cc=mobile@majumdar.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).