It gives the same error:
src/main.c:1954:16: error: writes 1 byte in a region of size 0
[-Werror=stringop-overflow=]
1954 | *(p - 1) = '\0';
| ~~~~~~~~~^~~~~~
Le 21/06/2021 à 16:12, David A. Wheeler a écrit :
p[-1] = '\0';
Is this just a style warning being turned into an error?
That is, would this compile if the line was rewritten as:
*(p - 1) = ‘\0’;
Which means the same thing per the spec?
If the rewrite would fix it, I suggest doing the rewrite, to
reduce compilation problems.
--- David A. Wheeler