Of course they can have the same name (even if one is part of the other) - but you can't have different tailf:code-name assignments for them. I.e. in this case "cws-umts-stats" for one of them, and none for the other.
Well, the question is why you are using tailf:code-name at all? But in any case, you need to either remove the tailf:code-name statement for the leaf, or add an identical statement for the container.
Yes, this was a bug - from the ConfD-5.4 CHANGES file:
- Toolchain: The tailf:code-name statement can not be used to assign
different code-names to different nodes with a given name, or assign a
code-name to only some nodes with a given name. The confdc --emit-xxx
operation would in such cases silently use one code-name assignment for
all the same-named nodes. This has been fixed - such inconsistent usage
of tailf:code-name will now result in a compilation error.
I.e. in your case you got (for the file generated by 'confdc --emit-h'):
#define <prefix>_cws_umts_stats 1128642429
#define for "umts".
The problem with this is that you may have assumed that you could differentiate between the container and the leaf based on the code-name, and expected
case <prefix>_cws_umts_stats: in a
switch statement to only match the leaf - but this is not the case, since they have the same integer value regardless of code-name, and you would get incorrect behavior at runtime when it actually matched the container.