This is the mail archive of the gcc-bugs@gcc.gnu.org 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]
Other format: [Raw text]

Re: c++/8214: [3.2/3.3 regression] character conversion problem


Old Synopsis: GCC does not enforce the left-most "const" in a  "const char * const"  declaration.
New Synopsis: [3.2/3.3 regression] character conversion problem

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Nov 22 11:36:51 2002
State-Changed-Why:
    Confirmed. This used to give an error with 2.95, but does
    no more. It is thus a regression. The code in question is
    -------------------------
    void foo(char *dest);
    
    int main() {
      const char * const p = "abc";
      foo (p);
    }
    ------------------------------
    The thing is weird, because if p is not initialized by 
    "abc" but with a null pointer, then gcc correctly gives
    an error...
    
    tmp/g> /home/bangerth/bin/gcc-3.3y-pre/bin/c++ -c x.cc
    tmp/g> /home/bangerth/bin/gcc-3.2.1-pre/bin/c++ -c x.cc
    tmp/g> c++ -c x.cc
    x.cc: In function `int main()':
    x.cc:5: passing `const char *const' as argument 1 of `foo(char *)' discards qualifiers
    

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8214


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