Unless the compiler decides that zeroing the memory doesn't do anything useful and optimizes it out.
Initializing your stack buffer probably does count as something useful, but in case it doesn't, try memset_s(3).
Like my brethren say it's probably a good idea to use a "secure" memset that won't have an accident ^W ^W ^W be optimized out.
Or keep >4kB objects off stack.
I mean, that's probably a good practice. In my case I sort of had this idea that largish objects should be placed on the heap but I couldn't really figure out a good reason why, or what the limit should be, so I guess this vuln proposes both a reason and that the page limit is a good threshold.