This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: PR 20599 (1/3)
Howard Hinnant <hhinnant@apple.com> writes:
| On Sep 25, 2006, at 7:30 AM, Gabriel Dos Reis wrote:
|
| > "Peter Dimov" <pdimov@mmltd.net> writes:
| >
| > [...]
| >
| > | > you can use that library code only if GCC gets to the point of
| > | > compiling it -- which can't happen when the compiler does not
| > | > understand the option. Concretely, the feature-test is illusory
| > | > unless you also change how
| > | > GCC handls unrecognized command-line options.
| > |
| > | But the library could support both modes, with or without the
| > | option.
| >
| > I do not disagree with that. However, it could be practically used
| > in the extended mode only if you know in advance that the compiler
| > supports it (because you have to explicit ask for it), which means
| > you're actually in the position of supplying the guarding macro.
|
| Without a feature-test macro, the library author will have to supply
| two separate implementations, and tell their clients: Use this
| version over here if you enable this feature, else use that version
| over there.
No. The *library author* defines the macros that guard its uses of
the specific GCC extensions. He/she does not need to provide two
separate implementations.
-- Gaby