Skip to content

Empty expression warnings fixed #1215

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 3 commits into from
May 11, 2019
Merged

Empty expression warnings fixed #1215

merged 3 commits into from
May 11, 2019

Conversation

offa
Copy link
Contributor

@offa offa commented Apr 27, 2019

Empty expression warnings fixed (#1206).

Together with #1205 this concludes the Clang 8 support.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.88% when pulling 87497ab on offa:macro_fixes into 7a58bf9 on cpputest:master.

@basvodde
Copy link
Member

I'm a bit about the while (0) causing a "always false" warning. Why wouldn't it?

@offa
Copy link
Contributor Author

offa commented Apr 28, 2019

I don't hope so. The do { .. } while(0) is a well known C / C++ construct for multiline macros. Also it's the only recommended way by MISRA C to solve this problem.

Do you have some specific platforms in mind?

@basvodde
Copy link
Member

Not really, just a worry. But let's proceed with this.

@basvodde basvodde merged commit 9be6d3d into cpputest:master May 11, 2019
@offa offa deleted the macro_fixes branch May 11, 2019 12:19
@jwgrenning
Copy link
Member

This did break pretty much all my training examples. Now I have to add semi-colons to CHECK, LONGS_EQUAL, FAIL usages.

I wonder how many more people will have their code broken.

@offa
Copy link
Contributor Author

offa commented Jun 17, 2019

Do you write different code in your trainings than in the book, articles and papers? 😕

@jwgrenning
Copy link
Member

I do, and often guiding clients. With a closer look, it's not all my training examples. I was somewhat inconsistent with semi-colons on checks. I've fixed them. Now its consistent, which is good too.

The book code was consistent to start with :-)

@jwgrenning
Copy link
Member

We might want to warn the mailing list. Was the mailing list warned? I could not find it quickly. I would have been really surprised if I did not remember this thread on github.

@offa
Copy link
Contributor Author

offa commented Jun 17, 2019

There is a mailing list? 😲

Maybe this is a good chance to create eg. a 3.9 release to indicate some kind of API differences?

@jwgrenning
Copy link
Member

I'll warn the cpputest google group for starters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants