Search code examples
assemblyarmclang

Does Clang's assembler support the "u" suffix for integer literals?


system/startup_mcore.S:374:22: expected')' 8466.word (0x43B90000u) 8467 When I'm using Clang-14.0.0 to compile an arm64 asm file,it gives the above errors. When I've deleted the "u" suffix, the errors disappered and the compiling passed. ChatGPT says that : The integer suffixes "u" and "U" indicate an unsigned integer type. Clang does not support the "u" suffix for integer literals. and the link given is text However, it takes a lot time and the words above haven't been found yet.(sad~~)

I'm expecting that is there any offcial documentation that defines this rule?


Solution

  • The integer size suffixes U, L, UL, ULL, LL, and so on are supported for the C, C++, and Objective C languages as per the respective language specifications. They are not supported for assembly source files and do not make sense there.

    Also I recommend not to trust AI assistants too much. Especially for niche topics they are likely to just hallucinate things.