-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using namespace codal
shouldn't be used in header files
#240
Comments
yes, indeed. I recall this was a necessary evil to get codal-microbit-v2 out before launch. Times were tight! Correct fix is the explicitly namespace the necessary types in header files to avoid namespace pollution... |
p.s. I also agree MicroBit.h is a special case, and leaving one in there does make sense I think, in the interesting of keep user programs simpler and not making breaking changes. |
maybe wrapped in a CONFIG option though, so the user can easily opt out should they wish to. |
Oh yeah, that'd be great! |
As part of: lancaster-university/codal-microbit-v2#240 Cannot remove all header files usage of `using namesapce` yet as that will affect other CODAL targets that might not have apply this type of patch yet.
As part of: lancaster-university/codal-microbit-v2#240 Cannot remove all header files usage of `using namesapce` yet as that will affect other CODAL targets that might not have apply this type of patch yet.
As part of: lancaster-university/codal-microbit-v2#240 Other targets should also apply patches like bdfa1ec to ensure they don't depend on the header files having the `using namespace codal` line.`
And headerfiles declare new clases in the codal namespace. This is part of: lancaster-university/codal-microbit-v2#240
And headerfiles declare new clases in the codal namespace. This is part of: lancaster-university/codal-microbit-v2#240 Co-authored-by: Carlos Pereira Atencio <[email protected]>
As part of: lancaster-university/codal-microbit-v2#240 Other targets should also apply patches like bdfa1ec to ensure they don't depend on the header files having the `using namespace codal` line.`
…al namespace. This is part of: lancaster-university/codal-microbit-v2#240 As removing 'using namespace codal' from codal-nrf52 can break a few targets, this patch adds a CODAL flag to enable/disable its usage.
…e. (#171) Flag mostly to be used in other CODAL libraries/targets. This is part of: lancaster-university/codal-microbit-v2#240 As removing 'using namespace codal' from codal-nrf52 can break a few targets, this patch adds a CODAL flag/macro to enable/disable its usage.
Flag introduced in codal-core in: lancaster-university/codal-core@509086c By default the `using namespace` line would still be present, as removing it can cause some codal targets to break if they depend on the header file to set up this namespace globally. For example, the codal-microbit-v2 target had this update to fix the namespacing: lancaster-university/codal-microbit-v2#437 This patch is part of: lancaster-university/codal-microbit-v2#240
Flag introduced in codal-core in: lancaster-university/codal-core@509086c By default the `using namespace` line would still be present, as removing it can cause some codal targets to break if they depend on the header file to set up this namespace globally. For example, the codal-microbit-v2 target had this update to fix the namespacing: lancaster-university/codal-microbit-v2#437 This patch is part of: lancaster-university/codal-microbit-v2#240
Flag introduced in codal-core in: lancaster-university/codal-core@509086c By default the `using namespace` line would still be present, as removing it can cause some codal targets to break if they depend on the namespace to be set up globally. For example, the codal-microbit-v2 target had this update to fix the namespacing: lancaster-university/codal-microbit-v2#437 This patch is part of: lancaster-university/codal-microbit-v2#240
Flag introduced in codal-core in: lancaster-university/codal-core@509086c By default the `using namespace` line would still be present, as removing it can cause some codal targets to break if they depend on the namespace to be set up globally. For example, the codal-microbit-v2 target had this update to fix the namespacing: lancaster-university/codal-microbit-v2#437 This patch is part of: lancaster-university/codal-microbit-v2#240
There are a few header files in the different CODAL repositories that have a
using namespace codal;
line, which forces the namespace into anything that includes it and can cause ambiguity and clashes when integrating with other libraires/SDKs (kind of defeats the point of using a codal namespace to begin with).I can see maybe a need to have it for
MicroBit.h
, but if we could remove its usage in all the other header files that would be useful.The text was updated successfully, but these errors were encountered: