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

uint64_t conflict in cygwin #862

Closed
rianquinn opened this issue Mar 18, 2017 · 6 comments
Closed

uint64_t conflict in cygwin #862

rianquinn opened this issue Mar 18, 2017 · 6 comments
Labels

Comments

@rianquinn
Copy link
Contributor

While compiling on cygwin in AppVeyor (I use the latest and greatest cygwin), I ran across this issue this morning:

/home/appveyor/bfprefix/include/catch/catch.hpp:2380:28: error: conflicting declaration ‘typedef long long unsigned int uint64_t’
 typedef unsigned long long uint64_t;
                            ^
In file included from /usr/include/stdint.h:14:0,
                 from /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/stdint.h:9,
                 from /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/cstdint:41,
                 from /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/bits/char_traits.h:420,
                 from /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/ios:40,
                 from /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/istream:38,
                 from /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/sstream:38,
                 from /home/appveyor/bfprefix/include/catch/catch.hpp:377,
                 from /cygdrive/c/projects/bfsdk/tests/test_errorcodes.cpp:23:
/usr/include/sys/_stdint.h:60:20: note: previous declaration as ‘typedef __uint64_t uint64_t’
 typedef __uint64_t uint64_t ;
                    ^

It appears that under cygwin, uint64_t does not need to be defined.

@horenmar horenmar added the Bug label Mar 29, 2017
@horenmar
Copy link
Member

Fixing this might be problematic, because I don't think we have had this problem before, so it might still be needed for older cygwin versions and I would really rather not go checking various cygwin versions for compatibility.

@lightmare
Copy link
Contributor

Why is Catch defining a type in the global namespace, anyway? Should define / alias uint64_t in its own namespace.

@rianquinn
Copy link
Contributor Author

I agree... you should not overwrite an existing type. Probably the best solution here is to create your own type or place this into a private namespace as suggested by @lightmare

@GatoRat
Copy link

GatoRat commented Apr 2, 2017

stdint.h is correct as of at least Visual Studio 2015 update 3 and should be used.

Its use is inconsistent with CATCH_CONFIG_CPP11_LONG_LONG.

@philsquared
Copy link
Collaborator

I've changed it so that (a) it doesn't define uint64_t itself - but rather introduces a new typedef (in the Catch namespace) and (b) only uses long long for _MSC_VER, rather than CATCH_WINDOWS - so should avoid the Cygwin issue.
It's not a complete solution as it doesn't account for potential older non-MS compilers that don't support uint64_t - but that's no worse than it was.
It also still doesn't respect CATCH_CONFIG_CPP11_LONG_LONG (which seems misnamed).
But I think this change should be enough to address this issue?

@philsquared philsquared added the Resolved - pending review Issue waiting for feedback from the original author label Apr 11, 2017
@horenmar
Copy link
Member

Since there has been no followup, I am going to assume that this is fixed.

@horenmar horenmar removed the Resolved - pending review Issue waiting for feedback from the original author label Apr 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants