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

visual studio 2012 suffix problem with LLU. UUL suffix would work #3663

Closed
halifir opened this issue May 31, 2023 · 1 comment · Fixed by #3664
Closed

visual studio 2012 suffix problem with LLU. UUL suffix would work #3663

halifir opened this issue May 31, 2023 · 1 comment · Fixed by #3664
Assignees

Comments

@halifir
Copy link

halifir commented May 31, 2023

Describe the bug
compile error
zstdlib.src/compress/zstd_compress.c(70) : error C2059: Syntaxfehler: 'Ungültiges Suffix für Zahl'
coming from zstd.h line ~231
#define ZSTD_MAX_INPUT_SIZE ((sizeof(size_t)==8) ? 0xFF00FF00FF00FF00LLU : 0xFF00FF00U)

you may change suffix from LLU to ULL

#define ZSTD_MAX_INPUT_SIZE ((sizeof(size_t)==8) ? 0xFF00FF00FF00FF00ULL : 0xFF00FF00U)
for visual studio 2012, if you like.

test a) in my vs2012 it will work with ULL

test b) in my visual studio 2013+2019 both ULL and LLU is working.

https://stackoverflow.com/questions/14588997/llu-bad-suffix-on-number
"Looking at the standards I have available to me (drafts only, but of reasonably recent versions), both C++ and C define both "ULL" and "LLU" as valid suffixes for an integer literal. This may be a recent change which VS2010 doesn't follow, but I note that VS2012 does the exact same thing (i.e only ULL works)."
"
In short: If you want to write portable C++ code, always use the ULL suffix for unsigned long long literals which will work as expected on Linux and Windows. –
Johannes Overmann
Mar 28, 2013 at 11:30
This has been fixed in VS2013. –
cremno
Apr 7, 2015 at 22:38
"

@Cyan4973 Cyan4973 self-assigned this May 31, 2023
@Cyan4973
Copy link
Contributor

Indeed, this is a simple fix.

We have already received this request, and the main issue was that we could not find a way to write a test on Github Actions to reproduce the issue, to observe that the fix is working, and also ensure the issue remains fixed during future updates.
That's because Github Actions doesn't support VS2012 and lower.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants