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

Cleaning conditional directives that break statements. #645

Open
wants to merge 4 commits into
base: bfgminer
Choose a base branch
from

Conversation

lzmths
Copy link

@lzmths lzmths commented Dec 7, 2015

A suggestion to compile entire statements and expressions, as suggested by code style guidelines from the Linux Kernel and practitioners.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/CodingStyle#n892
https://www.cqse.eu/en/blog/living-in-the-ifdef-hell/

It might improve code understanding, maintainability and error-proneness.

#ifdef UNIX_PATH_MAX
if (devpath_len >= UNIX_PATH_MAX)
test devpath_len >= UNIX_PATH_MAX;
Copy link
Owner

Choose a reason for hiding this comment

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

Pretty sure this is wrong?

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.

2 participants