Skip to content

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

Description

@wb7odyfred

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions