Ondřej Bílka <nel...@seznam.cz> writes: > As I commented on libc-alpha list that for string functions a header > expansion is better than builtins from maintainance perspective and also > that a header is lot easier to write and review than doing that in gcc > Jeff said that it belongs to gcc. When I asked about benefits he > couldn't say any so I ask again where are benefits of that?
It definitely has disadvantages in headers. Just today I was prevented from setting a conditional break point with strcmp in gdb because it expanded to a macro including __extension__ which gdb doesn't understand. The compiler has much more information than the headers. - It can do alias analysis, so to avoid needing to handle overlap and similar. - It can (sometimes) determine alignment, which is important information for tuning. - With profile feedback it can use value histograms to determine the best code. It may not use all of this today, but it could. -Andi -- a...@linux.intel.com -- Speaking for myself only