const: Add const keyword for all name pointer parameters #414
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull requests fixes the compiler warning when creating TX objects with literal strings since we are passing literal string to the function accepting
CHAR *
, that can, by design, modify input parameter and therefore cause undefined system behavior.All name pointers become
const CHAR*
type.There is no backward incompatibility when creating objects, but there is a potential backward in-compatibility when calling
tx_<modulename>_name_get
function, because parameter shall be changed toconst char* variable
.Currently we can get the name as:
New required function call:
I've not seen tests for getting the name in the threadx, I also clearly assume that people using
_get
api are the minority.From safety and quality standpoint, this upgrade makes a lot of sense.
PR checklist