From: Derek M Jones <derek@knosof.co.uk>
To: Michael Buesch <mb@bu3sch.de>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH] let sparse warn on &inline_function
Date: Sat, 20 May 2006 16:53:53 +0100 [thread overview]
Message-ID: <446F3B91.6020709@knosof.co.uk> (raw)
In-Reply-To: <200605201734.40756.mb@bu3sch.de>
Michael,
> The whole purpose of sparse is to warn on things that are
> not invalid to do, but don't make much sense. ;)
> It simply does not really make sense to mark something
> as "inline" and take pointers to it.
It makes perfect sense for me to want 'direct' calls to be
inlined and be willing to accept that calls via pointers
will not be inlined.
>> Presumably the address of a function is being taken because
>> it is needed. What is the developer supposed to do instead?
>> Rewrite an algorithm?
>
> define the function as outlined.
But then the compiler does not have the opportunity to
inline 'direct' calls.
>> Do you have any examples where this warning was useful?
>
> In most (all?) cases declaring a function as inline and taking
> a pointer to it afterwards does not make logical sense.
>
> It was originally done to catch things like:
The only place where I might be interested in a warning is
on the function definition. The warning might say something like
"This function is only called via pointers, so the compiler never
has the opportunity to inline (unless it can figure out that
the pointer to function only ever points at one function)."
--
Derek M. Jones tel: +44 (0) 1252 520 667
Knowledge Software Ltd mailto:derek@knosof.co.uk
Applications Standards Conformance Testing http://www.knosof.co.uk
next prev parent reply other threads:[~2006-05-20 15:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-20 14:21 [PATCH] let sparse warn on &inline_function Michael Buesch
2006-05-20 15:10 ` Derek M Jones
2006-05-20 15:34 ` Michael Buesch
2006-05-20 15:53 ` Derek M Jones [this message]
2006-05-21 19:37 ` Jörn Engel
2006-05-21 22:37 ` Derek M Jones
2006-05-22 8:36 ` Jörn Engel
2006-05-22 10:06 ` Derek M 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=446F3B91.6020709@knosof.co.uk \
--to=derek@knosof.co.uk \
--cc=linux-sparse@vger.kernel.org \
--cc=mb@bu3sch.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.