The fact that GCC issues a warning usually has nothing to do with whether the construct is legal C, but whether the GCC developers consider it either a likely indication that you meant something other than what you write, or just bad style. Here are some examples:
if (x = 0)— you almost surely meantif (x == 0).printf(str)— you almost surely meant eitherfputs(str, stdout)orprintf("%s", str); as written, the code is very dangerous.if (foo == bar & MASK)— you almost surely meantif (foo == (bar & MASK)).
etc.
In your case, I think GCC is questioning why you’re calling sprintf(String, "") to do the equivalent of String[0]=0; (the latter is much shorter, faster, and clearer).