XXH_INLINE_ALL and MSVC #219

Closed
opened 2019-06-25 13:18:32 -05:00 by paleozogt · 2 comments
paleozogt commented 2019-06-25 13:18:32 -05:00 (Migrated from github.com)

xxHash v0.7.0 with XXH_INLINE_ALL doesn't work on MSVC 2017.

Given this:

#define XXH_INLINE_ALL 1
#include "xxhash.h"

it fails with these errors:

z:\development\xxhash_test\libs\xxhash\xxh3.h(148): error C2156: pragma must be outside function
z:\development\xxhash_test\libs\xxhash\xxh3.h(295): warning C4244: 'argument': conversion from 'XXH64_hash_t' to 'unsigned int', possible loss of data
z:\development\xxhash_test\libs\xxhash\xxh3.h(616): error C2065: 'noinline': undeclared identifier
z:\development\xxhash_test\libs\xxhash\xxh3.h(616): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
z:\development\xxhash_test\libs\xxhash\xxh3.h(617): error C2448: '__attribute__': function-style initializer appears to be a function definition
z:\development\xxhash_test\libs\xxhash\xxh3.h(619): warning C4146: unary minus operator applied to unsigned type, result still unsigned
z:\development\xxhash_test\libs\xxhash\xxh3.h(689): warning C4244: 'argument': conversion from 'XXH64_hash_t' to 'unsigned int', possible loss of data
z:\development\xxhash_test\libs\xxhash\xxh3.h(690): warning C4244: 'argument': conversion from 'XXH64_hash_t' to 'unsigned int', possible loss of data
z:\development\xxhash_test\libs\xxhash\xxh3.h(691): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
z:\development\xxhash_test\libs\xxhash\xxh3.h(708): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
z:\development\xxhash_test\libs\xxhash\xxh3.h(725): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
z:\development\xxhash_test\libs\xxhash\xxh3.h(737): warning C4146: unary minus operator applied to unsigned type, result still unsigned
z:\development\xxhash_test\libs\xxhash\xxh3.h(737): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
z:\development\xxhash_test\libs\xxhash\xxh3.h(741): error C2065: 'noinline': undeclared identifier
z:\development\xxhash_test\libs\xxhash\xxh3.h(741): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
z:\development\xxhash_test\libs\xxhash\xxh3.h(741): error C2374: '__attribute__': redefinition; multiple initialization
z:\development\xxhash_test\libs\xxhash\xxh3.h(616): note: see declaration of '__attribute__'
z:\development\xxhash_test\libs\xxhash\xxh3.h(742): error C2448: '__attribute__': function-style initializer appears to be a function definition
z:\development\xxhash_test\libs\xxhash\xxh3.h(744): warning C4146: unary minus operator applied to unsigned type, result still unsigned
z:\development\xxhash_test\libs\xxhash\xxh3.h(753): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
z:\development\xxhash_test\libs\xxhash\xxh3.h(789): warning C4146: unary minus operator applied to unsigned type, result still unsigned
z:\development\xxhash_test\libs\xxhash\xxh3.h(789): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
xxHash **v0.7.0** with `XXH_INLINE_ALL` doesn't work on MSVC 2017. Given this: ``` #define XXH_INLINE_ALL 1 #include "xxhash.h" ``` it fails with these errors: ``` z:\development\xxhash_test\libs\xxhash\xxh3.h(148): error C2156: pragma must be outside function z:\development\xxhash_test\libs\xxhash\xxh3.h(295): warning C4244: 'argument': conversion from 'XXH64_hash_t' to 'unsigned int', possible loss of data z:\development\xxhash_test\libs\xxhash\xxh3.h(616): error C2065: 'noinline': undeclared identifier z:\development\xxhash_test\libs\xxhash\xxh3.h(616): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int z:\development\xxhash_test\libs\xxhash\xxh3.h(617): error C2448: '__attribute__': function-style initializer appears to be a function definition z:\development\xxhash_test\libs\xxhash\xxh3.h(619): warning C4146: unary minus operator applied to unsigned type, result still unsigned z:\development\xxhash_test\libs\xxhash\xxh3.h(689): warning C4244: 'argument': conversion from 'XXH64_hash_t' to 'unsigned int', possible loss of data z:\development\xxhash_test\libs\xxhash\xxh3.h(690): warning C4244: 'argument': conversion from 'XXH64_hash_t' to 'unsigned int', possible loss of data z:\development\xxhash_test\libs\xxhash\xxh3.h(691): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax z:\development\xxhash_test\libs\xxhash\xxh3.h(708): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax z:\development\xxhash_test\libs\xxhash\xxh3.h(725): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax z:\development\xxhash_test\libs\xxhash\xxh3.h(737): warning C4146: unary minus operator applied to unsigned type, result still unsigned z:\development\xxhash_test\libs\xxhash\xxh3.h(737): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax z:\development\xxhash_test\libs\xxhash\xxh3.h(741): error C2065: 'noinline': undeclared identifier z:\development\xxhash_test\libs\xxhash\xxh3.h(741): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int z:\development\xxhash_test\libs\xxhash\xxh3.h(741): error C2374: '__attribute__': redefinition; multiple initialization z:\development\xxhash_test\libs\xxhash\xxh3.h(616): note: see declaration of '__attribute__' z:\development\xxhash_test\libs\xxhash\xxh3.h(742): error C2448: '__attribute__': function-style initializer appears to be a function definition z:\development\xxhash_test\libs\xxhash\xxh3.h(744): warning C4146: unary minus operator applied to unsigned type, result still unsigned z:\development\xxhash_test\libs\xxhash\xxh3.h(753): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax z:\development\xxhash_test\libs\xxhash\xxh3.h(789): warning C4146: unary minus operator applied to unsigned type, result still unsigned z:\development\xxhash_test\libs\xxhash\xxh3.h(789): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax ```
Cyan4973 commented 2019-06-25 13:54:12 -05:00 (Migrated from github.com)

I think this issue is fixed in dev branch

I think this issue is fixed in `dev` branch
paleozogt commented 2019-06-26 16:08:38 -05:00 (Migrated from github.com)

Ah you're right. I tried the dev branch and it works.

Ah you're right. I tried the `dev` branch and it works.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Cyan4973/xxHash#219
No description provided.