This is the mail archive of the gcc-help@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]
Other format: [Raw text]

how is strcmp implemented so efficiently?


I noticed that strcmp is extremely smart. It knows when one parameter has constant length, determined at compile time. In that case it reverts to an inline version of the x86 string commands.

I looked into the headers and strcmp is defined as an extern(not inline.)

How would I ever write such an efficient function? Is it possible(even _with_ the use of asm?!)

Reza.


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