This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Suggestions for more built-ins.


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                       |
                                                         |

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]