Author: Chris Lattner Date: To: Ralf Wildenhues CC: Andrew Haley, gcc, x z Subject: Re: Feature request - a macro defined for GCC
On Jul 3, 2008, at 10:50 AM, Ralf Wildenhues wrote:
> Hello,
>
>>> Chris Lattner wrote:
>>>
>>>> IMO, the whole notion of a compiler-specific macro has pretty
>>>> limited
>>>> usefulness. Why not add macros for specific *features* offered by
>>>> the compiler. For example:
>>>>
>>>> #ifdef __SUPPORTS_NESTED_FUNCTIONS__
> [...]
>>> Hmm, looks like this could
>>> get very messy, very quickly; I don't think you could do this in any
>>> effective way without some compiler-independent organization to
>>> define
>>> these macros.
>
> I feel like I'm stating the obvious, but maybe you're just trying to
> rediscover feature-based tests: do a test compile that exposes the
> compiler bug or feature you're looking for.
>
> Autoconf provides a framework that supports this kind of testing,
> among
> others.