Changed returnCode enum fields to use the MQTT_ name prefix to avoid global namespace collisions #214
Conversation
…global namespace collisions Signed-off-by: Alex Shenfield <alex.shenfield@gmail.com>
Signed-off-by: Alex Shenfield <alex.shenfield@gmail.com>
|
Hi @scaprile, Thanks for pointing those out. Despite searching the issues I managed to totally miss both of those. You are probably correct - however, using such common enum values will keep causing problems for people (and not just with the ST libraries, but with use code too). To me it is somewhat indicative of "code smell" (this isn't singling out MQTTClient-C -> there are much more problems within the ST libraries themselves!). My hope is that this change will be at least picked up upstream (for example in the Keil MDK-Packs bundle of eclipse-paho) in situations where it will cause problems. Regards, Alex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When using the MQTTClient-C code with the STM32F7 series of microcontrollers (and the ST HAL libraries), there is a global namespace collision between the returnCode enum field in MQTTClient.h and the core stm32f7xx.h ErrorStatus enum. Best practice would be to use a name prefix to avoid these global namespace collisions so I've added one to the MQTTClient-C code.
Regards,
Alex