PaulStoffregen / SD

70 stars 41 forks source link

Some warnings with GCC 9 #23

Closed FrankBoesing closed 3 years ago

FrankBoesing commented 4 years ago
C:\Arduino\hardware\teensy\avr\libraries\SD\File.cpp: In constructor 'File::File(SdFile, const char*)':
C:\Arduino\hardware\teensy\avr\libraries\SD\File.cpp:26:37: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'class SdFile' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
   26 |     memcpy(_file, &f, sizeof(SdFile));
      |                                     ^
In file included from C:\Arduino\hardware\teensy\avr\libraries\SD/SD.h:23,
                 from C:\Arduino\hardware\teensy\avr\libraries\SD\File.cpp:15:
C:\Arduino\hardware\teensy\avr\libraries\SD/utility/SdFat.h:135:7: note: 'class SdFile' declared here
  135 | class SdFile : public Print {
      |       ^~~~~~

C:\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:445:15: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
  445 |     dateTime_(&p->creationDate, &p->creationTime);
      |               ^~~~~~~~~~~~~~~~
C:\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:445:15: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:445:33: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
  445 |     dateTime_(&p->creationDate, &p->creationTime);
      |                                 ^~~~~~~~~~~~~~~~
C:\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:445:33: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp: In member function 'uint8_t SdFile::sync()':
C:\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:973:17: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
  973 |       dateTime_(&d->lastWriteDate, &d->lastWriteTime);
      |                 ^~~~~~~~~~~~~~~~~
C:\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:973:17: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Arduino\hardware\teensy\avr\libraries\SD\utility\SdFile.cpp:973:36: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
  973 |       dateTime_(&d->lastWriteDate, &d->lastWriteTime);
      |                                    ^~~~~~~~~~~~~~~~~
FrankBoesing commented 3 years ago

This is outdated due to a new lib.