Skip to content

TESTS TOOLS - fix warnings #2818

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

Merged
merged 6 commits into from
Sep 28, 2016
Merged

TESTS TOOLS - fix warnings #2818

merged 6 commits into from
Sep 28, 2016

Conversation

pan-
Copy link
Member

@pan- pan- commented Sep 26, 2016

This PR fix warnings issued by ARMCC, IAR and GCC when compiling utest and greentea.

Some compiler will trigger warnings if code is located after the exit function
because this function never returns (by the standard...).
This change isolate properly functions and variable declared when
MBED_STACK_STATS_ENABLED is on.
@pan-
Copy link
Member Author

pan- commented Sep 26, 2016

@adbridge @bridadan @0xc0170 could you review this changeset ?

@mazimkhan
Copy link

retest uvisor

6 similar comments
@mazimkhan
Copy link

retest uvisor

@mazimkhan
Copy link

retest uvisor

@mazimkhan
Copy link

retest uvisor

@mazimkhan
Copy link

retest uvisor

@mazimkhan
Copy link

retest uvisor

@mazimkhan
Copy link

retest uvisor

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

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

LGTM

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

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

/morph test

Output

mbed Build Number: 957

All builds and test passed!

@@ -123,7 +123,6 @@ static int32_t utest_us_ticker_run()
callback();
}
}
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this not then complain about a function expecting to return a value but not supplying one?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, the compilers (ARMCC, GCC and IAR) doesn't complain because this functions never returns.
Actually the compiler was complaining of the return statement because it can't be reached.


static void send_heap_info(void);
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks a weird construct why not just
#ifdef MBED_STACK_STATS_ENABLED ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've used the same construct as the one which was already there: see here and there.

I believe the intent was to check that MBED_STACK_STATS_ENABLED is defined before testing its value.

@adbridge
Copy link
Contributor

Couple of comments @pan-

@sg- sg- merged commit 75cf250 into ARMmbed:master Sep 28, 2016
@pan- pan- deleted the fix_test_tools_warnings branch July 3, 2018 11:03
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.

6 participants