On 2005-05-24, at 06:00, Andrew Pinski wrote:
On May 24, 2005, at 12:01 AM, Zack Weinberg wrote:
Use of bare 'inline' is just plain wrong in our source code; this has
nothing to do with C++, no two C compilers implement bare 'inline'
alike. Patches to add 'static' to such functions (AND MAKING NO
OTHER
CHANGES) are preapproved, post-slush.
That will not work for the cases where the bare 'inline' are used
because they are external also in this case. Now this is where C99
and
C++ differs at what a bare 'inline' means so I have no idea what to
do, except for removing the 'inline' in first place.
This actually applies only to two function from libiberty:
/* Return the current size of given hash table. */
-inline size_t
-htab_size (htab)
- htab_t htab;
+size_t
+htab_size (htab_t htab)
{
return htab->size;
}
/* Return the current number of elements in given hash table. */
-inline size_t
-htab_elements (htab)
- htab_t htab;
+size_t
+htab_elements (htab_t htab)
{
return htab->n_elements - htab->n_deleted;
}
It could be resolved easy be moving those "macro wrappers" in to a
header
and making the static inline there. Actually this could improve the
GCC code
overall a bit.