This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: const_at_typedefed_type
- From: "John (Eljay) Love-Jensen" <eljay at adobe dot com>
- To: "Kalugsky Uriy" <urik at kiam1 dot rssi dot ru>, <gcc-help at gcc dot gnu dot org>
- Date: Fri, 19 Oct 2007 06:23:54 -0700
- Subject: RE: const_at_typedefed_type
- References: <200710191322.l9JDMVs64041@flox.kiam1.rssi.ru>
Hi Kalugsky,
> Could you explain, please, why the compiler ignores the 'const' in the functiion 'char_const_param(const TStr name)'.
There is a huge difference between:
char const*
char* const
Your "const TStr" parameter is a char* const.
You need a char const*. Or a char const* const will do, as well.
Change your typedef to:
typedef char const* TStr;
That will give you a char const* const as your parameter.
HTH,
--Eljay