Hacker News new | ask | show | jobs
by Marat_Dukhan 4442 days ago
I checked 3 compilers: icc 14, gcc 4.8, and clang 3.3. Clang is the only one which optimized the memset away.
2 comments

Did you enable optimization? I know first hand that GCC will optimize something similar out in many cases.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8537

Yes, I compiled with -O3.
Not a windows user so I can't check but given that it is the kernel driver the compiler we would be concerned about is the MS visual c++ compiler.
Visual C++ 2013 doesn't remove memset either.