0

I'm working on updating a very large codebase to be able to use gcc4.3 and ran into this issue. The question has been asked several times, however I think my situation is a little unique and Haven't been able to get a good explanation out of it.

The error I get is

error: deprecated conversion from string constant to 'realchar {aka char*}'

realchar refers to a typedef I have:

typedef char*   realchar;

public:
ClassNameIsMe(const realchar name="UsyncBndLNQueue");

changing realChar to be simply char* removes the warning. however shouldn't that be equivalent since it is a typedef pointing to char*?

mr odus
  • 172
  • 1
  • 2
  • 13
  • 1
    Possible duplicate of [typedef pointer const weirdness](http://stackoverflow.com/questions/8504411/typedef-pointer-const-weirdness) – gavv Jul 21 '16 at 14:19

1 Answers1

4

The problem is that const realchar name is const pointer to char, i.e it is equivalent to:

char * name const

instead of pointer to const char, which would be equivalent to:

const char * name

So the warning is valid.


See details here:

Community
  • 1
  • 1
gavv
  • 4,649
  • 1
  • 23
  • 40