On 06/17/2014 05:00 PM, Jakub Jelinek wrote:
GCC will likely not optimize it away at this point, but having code with
undefined behavior is just asking for future trouble. Just use "" instead?
It's always const and may lack sufficient alignment. The former isn't a
problem in C++ (I think), but the alignment is an issue.
Alignment for what? You don't specify any alignment to the C qsort,
You're returning a T *, not a void *, and C++ requires that pointers are
properly aligned even if they aren't dereferenced.
--
Florian Weimer / Red Hat Product Security Team