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

C11+ error found in source files, add spaces to literal identifier "PRIu64" change to " PRIu64 " #411

Open
wb7odyfred opened this issue Jan 24, 2023 · 0 comments

Comments

@wb7odyfred
Copy link

Examples of how to fix source code:
Put spaces around "PRIu64","PRIu32","PRId64"
" PRIu64 "," PRIu32 "," PRId64 "

C11_LITERAL_IDENT.TXT

URLs that show the same solution:
konstantinmiller/dashp2p#3 Similar example right here on github.com Konstant Miller share a fix
https://www.ibm.com/docs/en/ztpf/2019?topic=warnings-invalid-suffix-literal IBM thoughtful take on a fix.
https://sourcecodeartisan.com/2021/03/06/invalid-suffix-on-literal.html Great Source Code fix, that references Clang and GCC.

5 Files affected display.cpp files.cpp hash.cpp hashlist.cpp xml.h

files.cpp:512:42: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
ocb.error("%s: No hash found in line %"PRIu32, fn, count + 1);
^

files.cpp:545:29: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
ocb.error("%s: Expecting %"PRIu32" hashes, found %"PRIu32"\n",
^

files.cpp:545:53: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
ocb.error("%s: Expecting %"PRIu32" hashes, found %"PRIu32"\n",

1 warning and 3 errors generated.
*** Error code 1

Stop.
make: stopped in /usr/home/fred/hashdeep/src

clang --version
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
Target: aarch64-unknown-freebsd14.0
Thread model: posix
InstalledDir: /usr/bin
FreeBSD 14.0 running on a Raspberry Pi 4B with 8 GB dram.

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

No branches or pull requests

1 participant