[cfe-dev] What's the rationale to continue declare compatibility with GCC 4.2.1?

James Y Knight via cfe-dev cfe-dev at lists.llvm.org
Wed Jul 17 05:13:12 PDT 2019


The reason has always been that changing it would undoubtedly break some
software which uses features of newer GCCs that aren't implemented in
Clang. And there are indeed some of those features, even if they are weird
edge cases.

Also, by this point, Clang is a widely-enough used compiler, that I'd
expect most maintained software to be attempting to support it explicitly
-- best via __has_builtin/__has_feature/__has_attribute/etc tests as
applicable, falling back to the GCC version check if those macros don't
exist.

On Wed, Jul 17, 2019 at 7:22 AM Simon Atanasyan via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi,
>
> Recently I get a request to implement in Clang a MIPS-related feature
> which exists in GCC pre 4.4 and removed in later versions. There is a
> rationale behind such strange request -- third-party software checks a
> compiler's compatibility using __GNUC__,__GNUC_MINOR__ macros and
> selects code dedicated for obsoleted version of GCC.
>
> As to me I would use for __GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__
> macros defined in the InitializePredefinedMacros function the same
> values as a minimal GCC version required for building LLVM/Clang [1].
> Now it's 5.1.0.
>
> Is there any rationale to continue declare compatibility with old GCC
> 4.2.1?
>
> [1] https://llvm.org/docs/GettingStarted.html#software
>
> --
> Simon Atanasyan
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190717/2cbd7d70/attachment.html>


More information about the cfe-dev mailing list