-
Notifications
You must be signed in to change notification settings - Fork 48
Description
In project we have multiple CDDLs, and multiple scripts to build each.
--dq # to set the default quantity during generation MUST be the same for all CDDLs included in the project.
If it isn't, then with GNU GCC 14.x we get each DEFAULT_MAX_QTY check at generated_types.h file to fail. This was not a problem in GCC 13.x. Maybe it has to do with ordering or linking step setting a define, then checking the types.h file and passing, where perhaps GCC 14 is not doing the same order.
Solutions:
-
Make all your default qty the same value. This is what we chose. Anywhere we need different, we specify it in the CDDL
-
Give each generated DEFAULT_MAX_QTY it's own name. XXXXX_DEFAULT_MAX_QTY. Which isn't terrible, because ZCBOR is defining DEFAULT_MAX_QTY project wide, and that seems like a possible collision for a poorly named user define.
-
Limit the scope of the DEFAULT_MAX_QTY define to a C file instead of a .h that is included everywhere.
Additionally
- ZCBOR is currently re-defining DEFAULT_MAX_QTY with every
generated_types.hheader brought in. I don't think this is great. I suspect there should be an#ifndefat the the least.