This is the mail archive of the gcc@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: C++ interop issue due to non-null pointers


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


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