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

nxstyle should not complain on _Exit #1235

Closed
yamt opened this issue Jun 15, 2020 · 4 comments · Fixed by #1309
Closed

nxstyle should not complain on _Exit #1235

yamt opened this issue Jun 15, 2020 · 4 comments · Fixed by #1309

Comments

@yamt
Copy link
Contributor

yamt commented Jun 15, 2020

e.g.

% nxstyle stdlib.h
stdlib.h:152:19: error: Mixed case identifier found
@protobits
Copy link
Contributor

Maybe nxstyle could be extended to recognize some special comment that instructs to ignore a line (or at least a given rule for that line)

@patacongo
Copy link
Contributor

patacongo commented Jun 16, 2020

Maybe nxstyle could be extended to recognize some special comment that instructs to ignore a line (or at least a given rule for that line)

This has been discussed and I, for one, have been very opposed to corrupting good, clean C files with meta-data for nxstyle. People have talked about a lot of things and we have done the best we can to squash that approach. It is an unbounded, open-ended can or worms.

@yamt
Copy link
Contributor Author

yamt commented Jun 17, 2020

for this specific case (_Exit), as it's a part of the standards, it's more appropriate to make nxstyle itself know, IMO.

@Ouss4
Copy link
Member

Ouss4 commented Jun 18, 2020

There already is a white list in nxstyle.c, we can just add _Exit to the list.

diff --git a/tools/nxstyle.c b/tools/nxstyle.c
index 78351334bf..38b89f98df 100644
--- a/tools/nxstyle.c
+++ b/tools/nxstyle.c
@@ -192,6 +192,7 @@ static const char *g_white_prefix[] =
   "ub8",     /* Ref:  include/fixedmath.h */
   "ub16",    /* Ref:  include/fixedmath.h */
   "ub32",    /* Ref:  include/fixedmath.h */
+  "_Exit",   /* Ref:  include/stdlib.h */
   NULL
 };

That actually is just a prefix list but we can do the same for full identifiers.

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 a pull request may close this issue.

4 participants