Skip to content

Make TX_ENABLE_CONST_NAMES the default in 6.6 #780

Description

@fdesbiens

TX_ENABLE_CONST_NAMES shipped in 6.5.2 defaulting to off, in #761. It qualifies every object name as a pointer to const across create services, control blocks, information services, the module manager and trace registration. It is opt-in because it changes the type of a public struct field, and application code that copies a name into a writable CHAR * stops compiling — acceptable in a minor release, not in a patch one.

6.6 is where that default should change. Making it the default is one hunk in each tx_api.h, but the work around it is what matters.

Decide whether an escape hatch survives the flip. An integrator who cannot change their code needs something, and a second option that reverses the first is worth having only if we intend to remove it on a stated release rather than carry it indefinitely.

Build the option in CI before then. No configuration builds it today, so the const path only gets exercised when someone remembers to. The MISRA configurations are the ones that matter: every form of TX_CHAR_TO_UCHAR_POINTER_CONVERT but theirs casts the qualifier away silently, so they are the only ones that report a const name reaching a shim that takes CHAR *.

Carry the same switch through the components. USBX #275 and GUIX #189 are prepared against the qualification being the default, and the user guide's TX_ENABLE_CONST_NAMES entry will need rewriting again when it is. NetX Duo's NX_PACKET_DEBUG macro assigns tx_thread_identify() -> tx_thread_name into a CHAR *nx_packet_debug_thread; the field wants to be const CHAR *, which also settles the "ISR" literal assigned to it on the next line. The macro sits behind NX_ENABLE_PACKET_DEBUG_INFO, so no default build reaches it. FileX and LevelX need nothing.

Originally requested in #61.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions