jessek / hashdeep

Other
694 stars 130 forks source link

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

Open wb7odyfred opened 1 year ago

wb7odyfred commented 1 year ago

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: https://github.com/konstantinmiller/dashp2p/issues/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.