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

Naming conflict with GCC 11 #657

Closed
abougouffa opened this issue May 24, 2021 · 1 comment
Closed

Naming conflict with GCC 11 #657

abougouffa opened this issue May 24, 2021 · 1 comment

Comments

@abougouffa
Copy link
Contributor

I'm trying to compile a project which uses Pangolin, I got an error when compiling with GCC-11:

/usr/include/pangolin/utils/picojson.h:273:65: error: macro "_serialize" passed 2 arguments, but takes just 0
  273 |     template <typename Iter> void _serialize(Iter os, int indent) const;
...
...
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/serializeintrin.h:37: note: macro "_serialize" defined here
   37 | #define _serialize()    __builtin_ia32_serialize ()
      | 

In fact, GCC-11 defines a new macro _serialize, creating a conflict with the private member defined in pangolin/utils/picojson.h.

In general, I think it will be safer to name private members as something_ rather than _something since all names starting with an underscore are considered as reserved names in GCC

@stevenlovegrove
Copy link
Owner

Related to kazuho/picojson#141

Thanks again for this! Your PR is merged.

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.

2 participants