For a module I am working on
outputs[PULSES_OUTPUT].setChannels(16);
causes a warning during build
In member function 'void rack::engine::Port::setChannels(uint8_t)',
inlined from 'void TuringMachineModule::processParams(const rack::engine::Module::ProcessArgs&)' at
src/TuringMachine.cpp:449:43,
inlined from 'virtual void TuringMachineModule::process(const rack::engine::Module::ProcessArgs&)' at src/TuringMachine.cpp:505:26:
C:/Data/Cpp/Rack-SDK/include/engine/Port.hpp:163:35: warning: array subscript 16 is above array bounds of 'float [16]' [-Warray-bounds=]
163 | voltages[c] = 0.f;
| ~~~~~~~~~~^
C:/Data/Cpp/Rack-SDK/include/engine/Port.hpp: In member function 'virtual void TuringMachineModule::process(const rack::engine::Module::ProcessArgs&)':
C:/Data/Cpp/Rack-SDK/include/engine/Port.hpp:18:23: note: while referencing 'rack::engine::Port::<unnamed union>::voltages'
18 | float voltages[PORT_MAX_CHANNELS] = {};
| ^~~~~~~~
So as of now I’ve changed my code to simply set the channels property of my output-port without calling setChannels
outputs[PULSES_OUTPUT].channels = 16;