FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix three allocation related compiler warnings by kholia · Pull Request #95 · etherkit/Si5351Arduino · GitHub

Fix three allocation related compiler warnings - #95

Open
kholia wants to merge 1 commit into
etherkit:masterfrom
kholia:fix-allocation-related-warnings
Open

Fix three allocation related compiler warnings#95
kholia wants to merge 1 commit into
etherkit:masterfrom
kholia:fix-allocation-related-warnings

Conversation

kholia commented Nov 18, 2023

Copy link
Copy Markdown

Without this PR, I see the following warnings when compilation this library:

Arduino/libraries/Etherkit_Si5351/src/si5351.cpp: In member function 'void Si5351::set_pll(uint64_t, si5351_pll)':
Arduino/libraries/Etherkit_Si5351/src/si5351.cpp:568:10: warning: 'void operator delete(void*, std::size_t)' called on pointer returned from a mismatched allocation function [-Wmismatched-new-delete]
  568 |   delete params;
      |          ^~~~~~
Arduino/libraries/Etherkit_Si5351/src/si5351.cpp:522:35: note: returned from 'void* operator new [](std::size_t)'
  522 |   uint8_t *params = new uint8_t[20];
      |                                   ^
Arduino/libraries/Etherkit_Si5351/src/si5351.cpp: In member function 'void Si5351::set_vcxo(uint64_t, uint8_t)':
Arduino/libraries/Etherkit_Si5351/src/si5351.cpp:1243:16: warning: 'void operator delete(void*, std::size_t)' called on pointer returned from a mismatched allocation function [-Wmismatched-new-delete]
 1243 |         delete params;
      |                ^~~~~~
Arduino/libraries/Etherkit_Si5351/src/si5351.cpp:1206:41: note: returned from 'void* operator new [](std::size_t)'
 1206 |         uint8_t *params = new uint8_t[20];
      |                                         ^
Arduino/libraries/Etherkit_Si5351/src/si5351.cpp: In member function 'void Si5351::set_ms(si5351_clock, Si5351RegSet, uint8_t, uint8_t, uint8_t)':
Arduino/libraries/Etherkit_Si5351/src/si5351.cpp:675:16: warning: 'void operator delete(void*, std::size_t)' called on pointer returned from a mismatched allocation function [-Wmismatched-new-delete]
  675 |         delete params;
      |                ^~~~~~
Arduino/libraries/Etherkit_Si5351/src/si5351.cpp:586:41: note: returned from 'void* operator new [](std::size_t)'
  586 |         uint8_t *params = new uint8_t[20];

The changes in this PR fix these compiler warnings.

Thanks for your time, and attention.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL