I did not find anything in the C11 standard, stating that the string cannot be longer SIZE_MAX(where SIZE_MAXdenotes the maximum value of the type size_t). For instance. if SIZE_MAXthere is long, but in my implementation there is a type long longthat is strictly larger than long, then I could define and index such a string with long long.
However, this will mean some unusual situations: strlenfor example, it may not be possible to return the actual size of the string, since the result will be converted to size_tat the end, so the length string SIZE_MAX+1will be displayed as having a size of 0, for example. Does this, for example, violate the standard and thus prevent the existence of such strings? For reference, 7.24.6.3 only says that:
7.24.6.3 strlen function
Summary
#include <string.h>
size_t strlen(const char *s);
Description
The strlen function computes the length of the string pointed to by s.
Returns
The strlen function returns the number of characters preceding the terminating null character.
Am I missing something, or will it be completely true in (standard implementation) C11?