2 ms·
Both GCC and Clang support this with -fpascal-strings. "\pABC" actually gives you {3, 'A', 'B', 'C', 0} -- the \p is a character and so extends the length of th
by addaon 4y ago
Both GCC and Clang support this with -fpascal-strings. "\pABC" actually gives you {3, 'A', 'B', 'C', 0} -- the \p is a character and so extends the length of the string by one and it's still nul-terminated, it's not a pure (non-nul-terminated) pascal string.
- jwilk 4y agohttps://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fpascal-strings https://clang.llvm.org/docs/ClangCommandLineReference.html#c... Stock GCC doesn't have such option though. I guess it's implemented with a macOS-specific patch?
- JdeBP 4y agoSee https://gcc.gnu.org/legacy-ml/gcc/2003-11/msg00908.html https://gcc.gnu.org/legacy-ml/gcc/2003-11/msg00908.html
- jylam 4y agoDue to the legacy, forget to put a \p somewhere and you have a massive problem though