[lkml]   [2000]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Criticism] On the discussion about C++ modules

[Peter Samuelson]
> > Is this similar to the gcc 'const' attribute?
> >
> > int foo (int, char *) __attribute__((__const__));
> >
> > This is valid in GNU C (not just C++). Read the info page for
> > details.

[Eray Ozkural]
> Probably, I haven't used it in my C code though. I've found an
> article explaining the C9x restrict keyword at URL

OK, it appears your 'restrict' keyword has *nothing* to do with
"constant functions" as gcc implements them. 'restrict' is all about
pointers not being aliased. A gcc constant function, OTOH, is one
guaranteed not to have any side effects, so its return value can be
cached and reused by the optimizer. Two completely different things.

And I have no idea if gcc implements 'restrict' or not. As of 2.95 it
does do type-based alias optimizing, so I imagine at least a lot of the
infrastructure is there.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:41    [W:0.252 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site