This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add command line parsing of -fsanitize


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]