Paul Eggert <egg...@cs.ucla.edu> writes:

> I am adding some integer overflow checking to GNU Emacs, and RMS
> suggested that I make it a gnulib module, which sounds like a good
> suggestion, so here's a proposed module.

They seem like a good idea.

Did you consider adding some checking for their constraints, such
as checking that all of the arguments are really of the same
type?  This could be done with something like this, I think (not
tested, but you get the idea):

#ifdef __GNUC__
#define CHECK_COMPATIBLE_TYPES(A, B) \
        {( typeof(A) _gl_a; \
           typeof(B) _gl_b; \
           (void) sizeof(&_gl_a == &_gl_b); })
#else
#define CHECK_COMPATIBLE_TYPES(A, B)
#endif

or with __builtin_types_compatible_p() combined with the verify
macro.
-- 
Ben Pfaff 
http://benpfaff.org

Reply via email to