https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92718

--- Comment #3 from Ryan Libby <rlibby at gmail dot com> ---
(In reply to Martin Sebor from comment #2)
> Replacing the memset call with the assignment '*p = (struct s){ 0 };' avoids
> the warning and also results in better/optimal code.  (As suggested in
> pr36602, that would be a useful optimization independent of the warning.)

In the real code that prompted the warning, the struct has some members
which are declared const, which I believe prevents using aggregate
initialization as a workaround (or at least, it produces an error).

Reply via email to