This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

erroneous error -- inconsistent application of const

Relevant information:

  This bug involves the following EGCS release

  egcs-2.90.23 980102 (egcs-1.0.1 release)

  compiled with just configure and make.  egcs was built with gcc

Irrelevant information:

  My system is a vanilla RedHat 4.2 with nearly all patches available
  from RedHat.


Try compiling this file (

   class A
       static void f(char const * const * const argv);

   void f(char const * const * const argv);

   void g()
       char** a;

with the command g++ -pedantic -c

You get the error In function `void g()': no matching function for call to `A::f (char **&)' candidates are: A::f(const char *const *) <near match>

Note that it doesn't care about the global f; it just cares about the
f inside of A.  My understanding is that neither is wrong, but it is
certainly a bug that the compiler complains about one without
complaining about the other.

The last time I looked at a draft standard (actually, the ARM, with
revisions from April, 1995), "const" could be applied as many times as
necessary to function arguments....

E. Jay Berkenbilt (  |  Member, League for Programming Freedom            |,  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]