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

fix data type in test to pass build #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JasonRuonanWang
Copy link

This was broken on Mac with mgard_x serial option enabled.

@ben-e-whitney
Copy link
Collaborator

@qliu21, please hold off on merging this until we discuss it at a Tuesday meeting. This issue has come up in my rewrite of the Huffman compression code.

@JasonRuonanWang, were you getting a build error? Are std::int64_t and long int not the same type on your architecture?

@ben-e-whitney
Copy link
Collaborator

Are std::int64_t and long int not the same type on your architecture?

See this error encountered in #189.

@lindstro
Copy link

Apple clang thinks they're different types. This code

#include <cstdint>
#include <iostream>

template <typename T>
bool is_int64() { return std::is_same<T, std::int64_t>(); }

int main()
{
 std::cout << "int:           " << is_int64<int>() << std::endl;
 std::cout << "int64_t:       " << is_int64<int64_t>() << std::endl;
 std::cout << "long int:      " << is_int64<long int>() << std::endl;
 std::cout << "long long int: " << is_int64<long long int>() << std::endl;
 return 0;
}

outputs

int:           0
int64_t:       1
long int:      0
long long int: 1

long and long long have the same size and representation but are distinct types.

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 this pull request may close these issues.

3 participants