[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Dealing with compilers that pretend to be GCC

From: Paul_Koning
Subject: RE: Dealing with compilers that pretend to be GCC
Date: Thu, 19 Jan 2012 11:35:51 -0600

Write a test that checks for the existence of that machinery.  I agree with the 
earlier comments.  Checking version strings or program names is the wrong way, 
because you're essentially saying "if it is X then I know it can do Y" rather 
than directly asking the question "can it do Y".  The issue with "if it is X 
then..." is that a rule of that form is fragile.  Even if it is correct today 
-- which is unlikely -- it WILL be wrong tomorrow.  What matters for your 
purposes is "can it do Y" -- does it (1) support the language features you 
need, and (2) does it support the GCC plugin mechanism.  If the answer to both 
questions is yes, then your code should work, and it doesn't matter one bit 
whether the compiler calls itself GCC or FOOCC.


-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Ludovic Courtès
Sent: Thursday, January 19, 2012 11:52 AM
To: Paul Eggert
Cc: address@hidden; address@hidden
Subject: Re: Dealing with compilers that pretend to be GCC

Hi Paul,

Paul Eggert <address@hidden> skribis:

> A 'configure' script is supposed to check for behavior, not identity.
> If the compiler supports the features needed, then generally speaking 
> a 'configure' script shouldn't care whether the compiler is truly GCC.

Right.  But how would you write feature tests that would check (1) whether the 
GNU C language is supported, and (2) whether GCC plug-ins are supported?

That’s the problem I’m trying to solve.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]