David Spickett d889a7485f
[flang] Avoid UB in CharBlock Compare to C string (#147329)
The behaviour of strncmp is undefined if either string pointer is null
(https://en.cppreference.com/w/cpp/string/byte/strncmp.html).

I've copied the logic over from Compare to another CharBlock, which had
code to avoid UB in memcmp.

The test Preprocessing/kind-suffix.F90 was failing with UBSAN enabled,
and now passes.
2025-07-08 08:52:36 +01:00
..