This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dealing with compilers that pretend to be GCC
- From: Miles Bader <miles at gnu dot org>
- To: ludovic dot courtes at inria dot fr (Ludovic Courtès)
- Cc: Chris Lattner <clattner at apple dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 02 Feb 2012 20:00:39 +0900
- Subject: Re: Dealing with compilers that pretend to be GCC
- References: <87hazrzs5r.fsf@inria.fr> <4F182987.7000302@free.fr> <87y5t3wybv.fsf@inria.fr> <4F182F8E.7090907@free.fr> <20120120013812.GV6710@xvii.vinc17.org> <87r4yuggp5.fsf@inria.fr> <CAH6eHdRHsO1jWNMDwD+Cve_DJ3obUsos7Zd4dVsFGMKVrwfvew@mail.gmail.com> <20120121003228.GA8458@xvii.vinc17.org> <CAH6eHdSqsJJ3avK14+FPFRKR2RTFvyAtp6idNkhp1qhpyskhOg@mail.gmail.com> <799C9B12-FD77-4A40-BDD6-212B4C560F90@apple.com> <87zkd5w5ee.fsf@inria.fr> <F11409AA-8BF2-4A8F-A942-FA17C261A75A@apple.com> <87sjiwoxlv.fsf@inria.fr> <alpine.DEB.2.02.1201311353240.2407@laptop-mg.saclay.inria.fr> <87zkd4ko7b.fsf@inria.fr> <DBA45C7C-E815-4E1A-B165-31D6C5FA3772@apple.com> <871uqdsgj8.fsf@inria.fr>
ludovic.courtes@inria.fr (Ludovic CourtÃs) writes:
> Rather than assertions, one could use predicates:
>
> #if #has_builtin(foo) && #has_attribute(bar)
> ...
> #endif
>
> The difference being that (1) predicates were designed specifically for
> this purpose, and (2) thereâs no magic involved.
but ... predicates are (1) less portable, since they involve magic
syntax (whereas it's obvious how to make "magic macros" portable)
and (2) deprecated even in gcc...
-miles
--
You can hack anything you want, with TECO and DDT.