by davtbaum · 11y ago · 0 comments
It's dependent on the function attributes of memset (e.g. __attribute__((pure))) - it won't always be optimized out.
https://www.cs.auckland.ac.nz/references/c/gcc4.7/Function-A...
The compiler is allowed to optimize away that function call regardless of if it is memset or your own alternative.
Note that that is not the same thing as saying if it does currently optimize away that function call.