Skip to content

Consider declaring the name of the entities as "CHAR const *" instead of "CHAR *" #383

Open
@pirgia

Description

@pirgia

The functions that create an entity (thread, semaphore, etc.), take the entity's name as CHAR*.
I believe that, as the name isn't likely to change, the constness of the name (in the structures and the parameters) would be a nice to have feature.
But the reason of the request is that, while it is allowed in "C" to pass a constant string to a "char *" parameter, in C++ (starting from C++11) it is not allowed to pass a string literal (constant) to a "char *" parameter (ISO C++ forbids converting a string constant to 'CHAR *').
The latter forces the user (interfacing a C++ application with ThreadX) to const-cast the name of the entity, something like:

tx_thread_create(&thread1, const_cast<char*>("Thread name"),....);

which is ugly and, above all, not recommended by many coding standards.
I'd like to know your opinion.
Thanks for your attention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogThe issue or feature request has been added to the project backlog for prioritizationfeatureNew feature or enhancement request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions