Hi Jochen,
You can either hide this member from CINT (in particular if you do not need to store it as part of you object):
#ifndef __CINT__
const char * const * const bmember; //! #endif
or you can give CINT a white lie
#ifndef __CINT__
const char * const * const bmember; //! #else
const char **bmember; // would need to provide the size of the array here if I/O is needed. #endif
Cheers,
Philippe.
On 3/8/12 12:47 PM, Jochen Klein wrote:
> Hi,
>
> when I tried to have a class with a member of type
> const char * const * const
> the class itself compiles fine but there seems to be a problem with the
> ClassDef-generated code and I get the following error messages:
> -----
> root [0] .L test.C+
> Info in<TUnixSystem::ACLiC>: creating shared library /tmp/./test_C.so
> In file included from /tmp/test_C_ACLiC_dict.h:34:0,
> from /tmp/test_C_ACLiC_dict.cxx:17:
> /tmp/./test.C: In member function 'void test2::StreamerNVirtual(TBuffer&)':
> /tmp/./test.C:19:3: warning: declaration of 'b' shadows a member of 'this'
> /tmp/test_C_ACLiC_dict.cxx: In member function 'virtual void test2::ShowMembers(TMemberInspector&)':
> /tmp/test_C_ACLiC_dict.cxx:115:63: error: 'constb' was not declared in this scope
> g++: /tmp/test_C_ACLiC_dict.o: No such file or directory
> Error in<ACLiC>: Compilation failed!
> -----
> Without the ClassDef it compiles as intended.
>
> My objective is to have a constant (non-static) pointer to an array of
> constant pointers to string literals. The constness matters for
> optimization - at least I think it should but I have not verified it
> yet since it doesn't compile.
>
> Does the warning point to a real problem or is it intended that the
> variable gets hidden?
>
> In the assembly of "constb" instead of only b something goes wrong.
>
> Am I overlooking something or is there really a problem? A simple
> class to reproduce the problem is attached.
>
> Cheers,
> Jochen
Received on Fri Mar 09 2012 - 04:25:45 CET
This archive was generated by hypermail 2.2.0 : Fri Mar 09 2012 - 11:50:01 CET