public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* const qualifiers on function returns type
@ 2005-04-09  1:09 Benoit Boissinot
  0 siblings, 0 replies; 2+ messages in thread
From: Benoit Boissinot @ 2005-04-09  1:09 UTC (permalink / raw)
  To: linux-kernel

Hi,

there are some function who are declared this way:

include/linux/cpuset.h:21
extern const cpumask_t cpuset_cpus_allowed(const struct task_struct *p);

I was wondering what means const for a function returns type.
K&R doesn't say anything about this and gcc-4 warns (warning: type
qualifiers ignored on function return type)

If it is a mistake, there are a few functions who should be modified.

Regards,

Benoit

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: const qualifiers on function returns type
       [not found] <3RcNK-4PC-1@gated-at.bofh.it>
@ 2005-04-09  2:42 ` Bodo Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Bodo Eggert @ 2005-04-09  2:42 UTC (permalink / raw)
  To: Benoit Boissinot, linux-kernel

Benoit Boissinot <bboissin@gmail.com> wrote:

> extern const cpumask_t cpuset_cpus_allowed(const struct task_struct *p);
> 
> I was wondering what means const for a function returns type.
> K&R doesn't say anything about this and gcc-4 warns (warning: type
> qualifiers ignored on function return type)

It used to be a hint that the function has no side effect nor depends on
any variable besides the parameters. Calls to those functions may be cached
or omitted.
-- 
Fun things to slip into your budget
Paradigm pro-activator (a whole pack)
        (you mean beer?)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-09  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-09  1:09 const qualifiers on function returns type Benoit Boissinot
     [not found] <3RcNK-4PC-1@gated-at.bofh.it>
2005-04-09  2:42 ` Bodo Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox