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

Warning about __STDC_FORMAT_MACROS #91

Open
chishiro opened this issue Sep 24, 2016 · 0 comments · May be fixed by #127
Open

Warning about __STDC_FORMAT_MACROS #91

chishiro opened this issue Sep 24, 2016 · 0 comments · May be fixed by #127

Comments

@chishiro
Copy link

Hi!

I use picojson in my software.
Thank you for developing picojson!
Before including picojson.h, my software defines __STDC_FORMAT_MACROS and includes inttypes.h.
In this case, there is a warning about __STDC_FORMAT_MACROS.

picojson.h:71:10 warning: '__STDC_FORMAT_MACROS' macro redefined [-Wmacro-redefined]

To solve this problem, include guard is required as follows.

ifndef __STDC_FORMAT_MACROS

define __STDC_FORMAT_MACROS

endif

Please consider this revision.

NikolausDemmel added a commit to NikolausDemmel/picojson that referenced this issue May 13, 2020
Fixes kazuho#91 

Without this, if I include 2 libraries that define this macro, I get warnings like

```
warning: '__STDC_FORMAT_MACROS' macro redefined [-Wmacro-redefined]
```

This is on macos 10.15 with AppleClang 11.
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.

1 participant