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

Explicit parentheses for compound expressions #51

Closed
ethers opened this issue Aug 21, 2016 · 1 comment
Closed

Explicit parentheses for compound expressions #51

ethers opened this issue Aug 21, 2016 · 1 comment
Labels
Needs verification Needs references or proof of validity

Comments

@ethers
Copy link
Contributor

ethers commented Aug 21, 2016

Should we add this?

Rule 18
In compound expressions with multiple sub-expressions the intended
order of evaluation shall be made explicit with parentheses. [cf. MISRAC:2004
Rule 12.2]

http://lars-lab.jpl.nasa.gov/JPL_Coding_Standard_C.pdf

(we could add the obvious caveat that "However, do not add too many parentheses so as to clutter the code and make it unreadable." per MISRAC:2004 Rule 12.1)

@shayanb shayanb added the Needs verification Needs references or proof of validity label Jan 25, 2019
@maurelian
Copy link
Contributor

This would belong in a style guide section, which we do not have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs verification Needs references or proof of validity
Projects
None yet
Development

No branches or pull requests

3 participants