Skip to content

Add a lint option to warn about while (true) { ... } #1962

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

Closed
catamorphism opened this issue Mar 11, 2012 · 1 comment
Closed

Add a lint option to warn about while (true) { ... } #1962

catamorphism opened this issue Mar 11, 2012 · 1 comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone

Comments

@catamorphism
Copy link
Contributor

Now that we have loop{ ... }, maybe there should be a warning or lint flag to suggest changing while(true) {...} to loop{...}. (This will be helpful to the user as they may be able to remove spurious fails or unreachable calls.)

Since lint seems to just be concerned with ctypes right now, I'm not adding it yet since I'm not sure what the intent behind the current lint module is.

@graydon
Copy link
Contributor

graydon commented Mar 21, 2012

The intent of the module is to collect together every miscellaneous semantic check that there's any plausible disagreement over the warning-ness or error-ness of -- in terms of the severity a reasonable person might want -- such that users can control the warning-ness / error-ness themselves (using per-module attributes).

So this is an appropriate check. I expect lint will accumulate quite a lot of checks.

@ghost ghost assigned catamorphism Mar 21, 2012
@catamorphism catamorphism removed their assignment Jun 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants