[Top][All Lists]

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

Re: [Tinycc-devel] [patch] ignore qualifiers when comparing function par

From: Fabrice Bellard
Subject: Re: [Tinycc-devel] [patch] ignore qualifiers when comparing function parameters
Date: Fri, 29 Oct 2004 11:30:15 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803


I already made a fix in the CVS. It is different from yours as 'const' and 'volatile' are simply suppressed from the function prototype (they have a meaning only inside the function).


Dave Dodge wrote:
I have lots of code that results in constructs like this:

  extern void foo(int);
  void foo(int const x) { /* do something */ }

gcc and icc have no problem with this even in their strictest
settings, and I'm pretty sure I've used it with other compilers over
the years.  tcc 0.9.21 however rejects it because it sees "int" as not
being compatible with "int const".

According to N869 #11:
  (In the determination of type compatibility and of a composite type,
  each parameter declared with function or array type is taken as
  having the adjusted type and each parameter declared with qualified
  type is taken as having the unqualified version of its declared

The way I read this, qualifiers are supposed to be ignored when comparing
function parameters for compatibility.  The following patch implements
this for tcc.
                                                  -Dave Dodge


reply via email to

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