Paul Eggert wrote: > +/* Buffer too small: would like warning at compile time, but cannot > + easily do it due to GCC's mishandling of __builtin_object_size. */
I would reformulate this comment. The problem that you have with __builtin_object_size is that it cannot be part of a constant expression. But that is not a "mishandling" IMO: the building bricks of constant expressions are defined in ISO C. I see no compelling reason why GCC should extend its notion of constant expressions. One thing is troubling me, however: That __builtin_object_size can not return a really non-constant expression. In this case char buf[n < 0 ? 21 : 20]; return strdup (inttostr (n, &buf[0])); it returns (size_t)-1, that is, it gives up. Bruno