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

Consider being "Wzero-as-null-pointer-constant"-clean #408

Closed
alabuzhev opened this issue Nov 2, 2016 · 1 comment
Closed

Consider being "Wzero-as-null-pointer-constant"-clean #408

alabuzhev opened this issue Nov 2, 2016 · 1 comment

Comments

@alabuzhev
Copy link
Contributor

gcc 4.7 added a new command-line option -Wzero-as-null-pointer-constant to warn when a literal '0' is used as null pointer constant, which is useful to catch subtle errors as early as possible.

If this diagnostic is enabled project-wide, fmt produces a gazillion warnings because of things like Char *start = 0; in templates in the format.h. And since templates are instantiated in the user code, it's impossible to suppress this warning for fmt headers only.

Either nullptr or NULL should make gcc happy.
#define nullptr NULL is perfectly fine for pre-C++11 compilers.

@vitaut
Copy link
Contributor

vitaut commented Nov 2, 2016

Using NULL sounds reasonable. Would you be willing to submit a PR?

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

2 participants