Skip to content

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