Skip to content
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

Include mbed_debug.h in mbed.h #4185

Merged
merged 1 commit into from
May 18, 2017
Merged

Conversation

sarahmarshy
Copy link
Contributor

Description

Allows access to mbed debug printing when including mbed.h

Steps to test or reproduce

Currently, you must include mbed_debug.h in addition to mbed.h if you want to use the debug print function.

Copy link
Contributor

@geky geky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@geky geky added the needs: CI label Apr 13, 2017
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 18, 2017

/morph test

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 18, 2017

@tommikas I restarted Jenkins again, can you have a look at the failure? I don't find it related to this changeset

@bridadan
Copy link
Contributor

/morph test

@tommikas
Copy link
Contributor

@0xc0170 It sort of is related. This inclusion causes a conflict between two functions called debug.

Compile [ 52.5%]: LoWPANNDInterface.cpp
[Error] ns_trace.h@81,25: conflicting declaration of C function 'void debug(const char*)'
[ERROR] In file included from ./mbed-os/features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/source/LoWPANNDInterface.cpp:7:0:
./mbed-os/features/FEATURE_COMMON_PAL/nanostack-libservice/mbed-client-libservice/ns_trace.h:81:25: error: conflicting declaration of C function 'void debug(const char*)'
 void debug(const char *s);                                                          //!< obsolete function
                         ^
In file included from ./mbed-os/mbed.h:66:0,
                 from ./mbed-os/features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h:19,
                 from ./mbed-os/features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/mbed-mesh-api/LoWPANNDInterface.h:20,
                 from ./mbed-os/features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/source/LoWPANNDInterface.cpp:1:
./mbed-os/platform/mbed_debug.h:35:20: note: previous declaration 'void debug(const char*, ...)'
 static inline void debug(const char *format, ...) {

https://github.com/ARMmbed/mbed-os/blob/master/platform/mbed_debug.h#L60
https://github.com/ARMmbed/mbed-os/blob/master/features/FEATURE_COMMON_PAL/nanostack-libservice/mbed-client-libservice/ns_trace.h#L81

The version in nanostack-libservice is a legacy function that was left for backwards compatibility when migrating to using mbed-trace. I think it could safely be cleaned out at this point.

@SeppoTakalo, @kjbracey-arm, what do you think?

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 29

All builds and test passed!

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 19, 2017

@SeppoTakalo, @kjbracey-arm, what do you think?

Any ideas?

@SeppoTakalo
Copy link
Contributor

@0xc0170 @tommikas Yes, the debug() function can, and should, be removed from ns_trace library.

I'll propose that ns_trace would be changed first and once its changes are merged into master repo, the change would be merged in mbed-os also. Then this would pass the build.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 20, 2017

I'll propose that ns_trace would be changed first and once its changes are merged into master repo, the change would be merged in mbed-os also. Then this would pass the build.

Ok, who can take the action for this one? I'll label this as "needs work"

@tommikas
Copy link
Contributor

I actually seem to have an old PR into libservice to clean out some ns_trace stuff. I think the PR got left hanging due to summer holidays and organizational changes. I'll update that. Once that is in @SeppoTakalo or someone can submit the updated libservice here.

@theotherjimmy
Copy link
Contributor

bump @SeppoTakalo

@tommikas
Copy link
Contributor

@theotherjimmy Just updated the aforementioned PR.

@theotherjimmy
Copy link
Contributor

@SeppoTakalo @tommikas What's the status of this?

@theotherjimmy
Copy link
Contributor

@sarahmarshy What's the status of this one?

@tommikas
Copy link
Contributor

tommikas commented May 2, 2017

@theotherjimmy #4235 should unblock this.

@tommikas
Copy link
Contributor

#4235 has been merged. CI is passing now.

@sg- sg- merged commit bcc69b4 into ARMmbed:master May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants