I came across this question when Googling looked that the memset was back.
I have a code where I test a single value, then if it is a true test to see if the value is zeros.
Since there is no fully portable way to check for zero in C, I need to run memset in the middle.
So my code is:
if ( a==true && (memcmp(memset(zeros, 0, sizeof(zeros)), b, sizeof(zeros)) == 0) )
This speaks of the chain of goals listed in previous questions, but this is an example of use for this technique.
I will leave it to others to judge whether this encoding is good or not.
Gerard Nicol May 20 '13 at 3:29 a.m. 2013-05-20 03:29
source share