Re: [PATCH] let sparse warn on &inline_function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx
Applications Standards Conformance Testing    http://www.knosof.co.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux