[cfe-dev] david's integer overflow stuff

John Regehr regehr at cs.utah.edu
Sun Sep 12 22:29:32 PDT 2010


David, can you give some details (or a pointer) about the trap handling 
interface you have been using?

Our trap interface is below.  It needs work but it has been useful in 
making it possible to print highly informative error messages about 
integer problems.

Moving forward, it seems to make sense to give clang -trapv (or -fcheckv 
or whatever) the ability to:

- abort

- call a lightweight trap handler, designed for performance

- call a heavyweight trap handler like ours below, designed for verbosity

John


static unsigned long long undefined_behavior_trap_handler (unsigned int line,
 					     unsigned int column,
 					     char *filename,
 					     char *opstr,
 					     char *rule,
 					     signed char ub,
 					     signed char ltype,
 					     signed char rtype,
 					     unsigned long long lvalue,
 					     unsigned long long rvalue)



More information about the cfe-dev mailing list