Skip to content

DEFAULT_MAX_QTY has issues with multiple CDDLs in project #507

@jnz86

Description

@jnz86

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.h header brought in. I don't think this is great. I suspect there should be an #ifndef at the the least.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions