This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Suggestions for more built-ins.
- To: Marc Espie <Marc dot Espie at liafa dot jussieu dot fr>
- Subject: Re: Suggestions for more built-ins.
- From: Marc Lehmann <marc at gimp dot org>
- Date: Sun, 16 Jan 2000 10:30:58 +0100
- Cc: egcs at egcs dot cygnus dot com
- References: <20000113205933.A6944@liafa1.liafa.jussieu.fr>
On Thu, Jan 13, 2000 at 08:59:33PM +0100, Marc Espie <Marc.Espie@liafa.jussieu.fr> wrote:
> - strchr(p, '\0') == p + strlen(p)
Would this be at runtime (if yes, this would obviously penalize most code)?
If not, and you are only intersted in an compile-time optimization, then
why not use an inline function (even a mcro) that detects this case and
turns it into the p+strlen case?
> - strchr(constant_string, c) is a nice short-hand for checking whether a
This is more difficult (impossible?) to do without compiler support.
--
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@opengroup.org |e|
-=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE --+
The choice of a GNU generation |
|