[cfe-dev] FixIt idea: memset(buf, sizeof(buf), fill_val) => memset(buf, fill_val, sizeof(buf))

Jevin Sweval jevinsweval at gmail.com
Mon Mar 24 10:03:09 PDT 2014


Howdy,

I just found myself making the mistake mentioned in the subject. No
warnings, even with -Weverything. The fixit would recognize a sizeof()
in the fill value position and suggest the swap.

Does anyone think this would be a useful fixit? I'd like to take a
stab at implementing it if it wouldn't be too hard for a Clang
beginner.

Cheers,
Jevin



More information about the cfe-dev mailing list