arduino / arduino/ArduinoCore-avr
Compilation warning: `unused parameter 'size'`
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Compilation of the core produces warnings for the unused `size` parameter of the `delete` operator:
```
/home/me/.arduino15/packages/arduino/hardware/avr/1.8.7/cores/arduino/new.cpp: In function 'void operator delete(void*, std::size_t)':
/home/me/.arduino15/packages/arduino/hardware/avr/1.8.7/cores/arduino/new.cpp:95:45: warning: unused parameter 'size' [-Wunused-parameter]
void operator delete(void* ptr, std::size_t size) noexcept {
^~~~
/home/me/.arduino15/packages/arduino/hardware/avr/1.8.7/cores/arduino/new.cpp: In function 'void operator delete [](void*, std::size_t)':
/home/me/.arduino15/packages/arduino/hardware/avr/1.8.7/cores/arduino/new.cpp:98:48: warning: unused parameter 'size' [-Wunused-parameter]
void operator delete[](void * ptr, std::size_t size) noexcept {
```
Please mark those parameters with `[[gnu::unused]]` or `__attribute__((unused))`.
https://github.com/arduino/ArduinoCore-avr/blob/d5d1355b95fd57bbcd30b86db5dc0003440eee8d/cores/arduino/new.cpp#L95-L97
### Additional context
#### Related
- https://github.com/arduino/ArduinoCore-avr/pull/487
- https://github.com/arduino/ArduinoCore-avr/issues/508
- https://github.com/arduino/ArduinoCore-avr/pull/631
Contributor guide
No contributing guide indexed for this repository
Research direction
Open cores/arduino/new.cpp around lines 95-98 and inspect the two sized delete operators that trigger the unused-parameter warnings. Apply the requested unused-parameter marking and compile the Arduino AVR core with warnings enabled; done means those warnings no longer appear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100