On Mon, Jun 17, 2013 at 03:52:54PM +0000, Joseph S. Myers wrote: > On Mon, 17 Jun 2013, Jakub Jelinek wrote: > > > > +; What the sanitizer should instrument > > > +Variable > > > +unsigned int flag_sanitize > > > > Can't you just add Var(flag_sanitize) to the line after fsanitize= ? > > I think that would create a string variable, whereas an integer is what's > wanted here.
We already have say: Wstack-usage= Common Joined RejectNegative UInteger Var(warn_stack_usage) Init(-1) Warning Warn if stack usage might be larger than specified amount that creates #ifdef GENERATOR_FILE extern int warn_stack_usage; #else int x_warn_stack_usage; #define warn_stack_usage global_options.x_warn_stack_usage #endif so I guess UInteger Var(flag_sanitize) then would do the trick. Though, now looking at it, -fsanitize={address,thread} aren't RejectNegative, so they accept also -fno-sanitize=address etc. Marek, thus your patch should handle that properly too, say if you do: -fsanitize=undefined -fno-sanitize=shift it should first or into the flag_sanitize bitmask SANITIZE_UNDEFINED and then and it with ~SANITIZE_SHIFT. Jakub