[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53544] -Wclass-memaccess warnings
From: |
John W. Eaton |
Subject: |
[Octave-bug-tracker] [bug #53544] -Wclass-memaccess warnings |
Date: |
Mon, 2 Apr 2018 12:38:56 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 |
Follow-up Comment #2, bug #53544 (project octave):
I hope there is a better way, but does the attached patch avoid the warning?
I think the problem is that octave_intN and octave_uintN types are classes,
not POD types, so passing a pointer to an octave_intN object to memcpy is
questionable. But we know it is OK because these objects contain only a
single data member that is the corresponding intN_t value.
This problem comes up often because sometimes we want an array of octave_intN
objects and sometimes we want an array of intN_t objects. Maybe we can use
some template specializations to do better than the current fortra_vec
function. That's something we can look at after the release.
(file #43770)
_______________________________________________________
Additional Item Attachment:
File name: int-cast-diffs Size:3 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?53544>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/