Repository navigation
Closed
Labels
area: coreLED drivers, color math, animationsstatus: staleNo activity for 60+ daysstatus: triageNeeds initial assessment
Description
I'm not sure if they are worth fixing/easy to fix. Full list attached:
out.txt
libraries/FastLED/colorutils.h: In copy constructor ‘CHSVPalette16::CHSVPalette16(const CHSVPalette16&)’:
libraries/FastLED/colorutils.h:455:69: warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct CHSV’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memmove8( &(entries[0]), &(rhs.entries[0]), sizeof( entries));
^
In file included from libraries/FastLED/controller.h:9,
from libraries/FastLED/FastLED.h:47,
from examples/GFX_Table_Mark_Estes/neomatrix_config.h:112,
from examples/GFX_Table_Mark_Estes/Table_Mark_Estes.ino:5,
from src/main.cpp:13:
libraries/FastLED/pixeltypes.h:23:8: note: ‘struct CHSV’ declared here
struct CHSV {
^~~~
In file included from libraries/FastLED/FastLED.h:58,
from examples/GFX_Table_Mark_Estes/neomatrix_config.h:112,
from examples/GFX_Table_Mark_Estes/Table_Mark_Estes.ino:5,
from src/main.cpp:13:
libraries/FastLED/colorutils.h: In member function ‘CHSVPalette16& CHSVPalette16::operator=(const CHSVPalette16&)’:
libraries/FastLED/colorutils.h:459:69: warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct CHSV’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memmove8( &(entries[0]), &(rhs.entries[0]), sizeof( entries));
^
In file included from libraries/FastLED/controller.h:9,
from libraries/FastLED/FastLED.h:47,
from examples/GFX_Table_Mark_Estes/neomatrix_config.h:112,
from examples/GFX_Table_Mark_Estes/Table_Mark_Estes.ino:5,
from src/main.cpp:13:
libraries/FastLED/pixeltypes.h:23:8: note: ‘struct CHSV’ declared here
struct CHSV {
^~~~
In file included from libraries/FastLED/FastLED.h:58,
from examples/GFX_Table_Mark_Estes/neomatrix_config.h:112,
from examples/GFX_Table_Mark_Estes/Table_Mark_Estes.ino:5,
from src/main.cpp:13:
libraries/FastLED/colorutils.h: In copy constructor ‘CHSVPalette256::CHSVPalette256(const CHSVPalette256&)’:
libraries/FastLED/colorutils.h:558:69: warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘struct CHSV’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memmove8( &(entries[0]), &(rhs.entries[0]), sizeof( entries));
Metadata
Metadata
Assignees
Labels
area: coreLED drivers, color math, animationsstatus: staleNo activity for 60+ daysstatus: triageNeeds initial assessment
Type
Projects
- StatusShow more project fieldsDone
Activity
5chmidti commentedon Mar 21, 2020
How about casting to a
void*to get around it being recognized as astruct CHSVinmemmove8. Because the copy constructor ofCHSVPalette16is usingmemmoveanyways, there is no need to have it complain about not having a trivial copy constructor. (I guess this is true for all CHSVPalettes)Would need to cast at ln 455 and 459 to test this. I cant, as I would need a newer gcc version
EDIT: see #971 (comment)
Fix gcc warnings FastLED#985
marcmerlin commentedon Mar 24, 2020
Thanks @5chmidti this did quiet the warnings, I just wanted to make sure that this was ok/safe to do.
MarcFork@be2013e
marcmerlin commentedon Mar 24, 2020
I cherry picked this into master: #986
Not sure who has review power outside of @kriegsman , do you by any chance?
5chmidti commentedon Mar 25, 2020
I believe everybody can review changes in a pull request. Merging is reserved for people with write permission.
I looked at it once more and wrote something in the pr to completely remove the warning instead of going around it.
5chmidti commentedon Mar 27, 2020
As I've said in the pr (should have stayed here, to keep the discussion in here):
I've gone ahead and commited these changes to my fork.
Performance wise there shouldn't be a difference between this and the master, but if someone knows how to reliably check, please do so. I've done some testing myself and found that they are about the same (no major difference / within margin of error).
5chmidti commentedon Mar 28, 2020
I've opened #990
There was actually a similar discussion at #971
marcmerlin commentedon Mar 28, 2020
Thanks for following up on this (been busy/distracted with other things)
zackees commentedon Aug 20, 2026
Resolved by #986 and #990. Verified: both PRs merged to master; #986 removed the reported palette memmove warning sites and #990 made CRGB/CHSV copy construction and assignment trivial, which the current implementation retains.