check_type_size silently wraps for large sizes
When using check_type_size
on very large types (e.g. char[123456]
) the size is reported modulo 100000. This can lead to incorrect results for cmake files that use this to get the value of preprocessor definitions.
This can be avoided by including a line in the generated source file like char size_assert[(SIZE<100000)*2-1];
so that large types will report an error instead of giving incorrect data.