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

Support standard type 'bool' #27

Closed
ascherer opened this issue Jun 12, 2021 · 3 comments
Closed

Support standard type 'bool' #27

ascherer opened this issue Jun 12, 2021 · 3 comments

Comments

@ascherer
Copy link

After my code declares

#include <stdbool.h>
...
typedef bool boolean;

splint common.c complains

common.h:36:14: Type boolean is probably meant as a boolean type, but the
    boolean type name is not set. Use -booltype boolean to set it.
  Use the -booltype, -boolfalse and -booltrue flags to change the name of the
  default boolean type. (Use -likelybool to inhibit warning)

and splint -booltype boolean common.c complains

common.h:36:14: Boolean type boolean defined using non-standard type bool
                   (integral, char or enum type expected)

Please add support for “non-standard standard type bool”.

@ascherer
Copy link
Author

Note to self: This may be a user error, fixable by setting some command-line flags. stdbool.h seems to be used in splint already.

@rillig
Copy link

rillig commented Oct 11, 2021

I don't think this is a user error. The intention of the code is very clear, therefore no additional command line option should be necessary. The option -booltype was useful before C99 to specify which of the many typedefs for int or unsigned char was meant to be a boolean type, and back then, that was useful.

@cooljeanius
Copy link

This kinda ties in with bug #12

@ascherer ascherer closed this as completed Sep 6, 2024
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

No branches or pull requests

3 participants