Is there a command line option for confdc to give more detail about where the enum conflict is happening other than just the name?
I’m getting
Warning: the following symbols have been suppressed due to a
conflict with an enum or bit with the same mapped name but a different value:
'UNKNOWN'.
when compiling a module, and I’ve gone through the module and I’m fairly sure all its imports (and imports imports!), and added a unique code-name to all instances of enum UNKNOWN I can find, but I’m still getting the error.
See the confdc(1) man page for what your options are:
...
--macro-prefix Prefix
Without this option, all macro definitions in the generated .h file are prepended with the argument of the prefix statement in the YANG module. If this
option is used, the macro definitions are prepended with Prefix instead.
...
--exclude-enums
If this option is used, macro definitions for enums are omitted from the generated .h file. This can in some cases be useful to avoid conflicts between
enum symbols, or between enums and other symbols.
...
There’s no way to assign a prefix per typedef though is there? It’s per .fxs?
In my code, module a imports b, c, and d. All 3 imports define a typedef for enumeration (each typedef has a different name) containing a enum UNKNOWN, each with a different value.
If you are using confdc flags it is per YANG module/FXS file.
If you want to assign a prefix on some enum but not some other, then you need to use tailf:code-name.
If there are 58 typedefs with enums in them I suggest you first add those tailf:code-name + tailf-common import statements directly into a copy of the original YANG file and then generate the annotation file using this Python script:
Wish there was a way to have it generate those annotation-statement blocks based on any enums it finds, but this will definitely cut down on my workload.
Using that quite simple Python script as inspiration, you can likely easily create a script that generates tailf:annotate-statement:s for enum statements found in a YANG file according to your needs.
I wish it handled enums the same way protobufs do (enumeration uses its name as the prefix for all the enums within) but I will look into crafting a python script to use the typedef name as the prefix.