The relevant part of the specification is really this one
7.21 String handling
7.21.1 String function conventions
2 Where an argument declared as size_t n specifies the length of the array for a function, n can have the value zero on a call to that function. Unless explicitly stated otherwise in the description of a particular function in this subclause, pointer arguments on such a call shall still have valid values, as described in 7.1.4. On such a call, a function that locates a character finds no occurrence, a function that compares two character sequences returns zero, and a function that copies characters copies zero characters.
That means that memcmp
is guaranteed to return zero when the supplied sequence length is zero.