This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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 1/2] Replace check_mul_overflow_size_t with INT_MULTIPLY_WRAPV


Florian Weimer wrote:
-  bool overflow = check_mul_overflow_size_t (element_size, count, &size);
+  bool overflow = INT_MULTIPLY_WRAPV (element_size, count, &size);
What's the reason for not using the compiler built-in?

Presumably Adhemerval wrote that patch before Joseph's commit yesterday that bumped glibc's minimum GCC requirement from GCC 4.9 to GCC 5. But you're right, now that we're requiring GCC 5 the code can use __builtin_mul_overflow instead of INT_MULTIPLY_WRAPV. And using the builtin would address DJ's concern as well. So it would be better to redo the patch that way.


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