progmem error
Opened this issue · 17 comments
When trying to compile some example, I get the following error.
/usr/share/arduino/libraries/synth/tables.h:59:23: error: variable ‘SinTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:319:28: error: variable ‘TriangleTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:579:27: error: variable ‘SquareTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:839:23: error: variable ‘SawTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1099:24: error: variable ‘RampTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1359:25: error: variable ‘NoiseTable’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1619:19: error: variable ‘Env0’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1753:19: error: variable ‘Env1’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1888:19: error: variable ‘Env2’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:2023:19: error: variable ‘Env3’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
make: *** [.build/uno/src/sketch.o] Error 1
I have avr-gcc 4.7.2 installed on debian. which version of avr-gcc are you using?
Any idea how to fix this?
Hi.
I don't know which version of GCC. I have tried with whatever comes with
Arduino 1.0.1 - 1.1.5 and these uses the same convention for progmem.
I think the progmem naming changed between Arduino 0 and 1, try getting the
newest version.
Dzl
On Sun, Apr 27, 2014 at 4:12 AM, bakad notifications@github.com wrote:
When trying to compile some example, I get the following error.
/usr/share/arduino/libraries/synth/tables.h:59:23: error: variable
‘SinTable’ must be const in order to be put into read-only section by means
of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:319:28: error: variable
‘TriangleTable’ must be const in order to be put into read-only section by
means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:579:27: error: variable
‘SquareTable’ must be const in order to be put into read-only section by
means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:839:23: error: variable
‘SawTable’ must be const in order to be put into read-only section by means
of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1099:24: error: variable
‘RampTable’ must be const in order to be put into read-only section by
means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1359:25: error: variable
‘NoiseTable’ must be const in order to be put into read-only section by
means of ‘attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1619:19: error: variable
‘Env0’ must be const in order to be put into read-only section by means of ‘
attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1753:19: error: variable
‘Env1’ must be const in order to be put into read-only section by means of ‘
attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:1888:19: error: variable
‘Env2’ must be const in order to be put into read-only section by means of ‘
attribute((progmem))’
/usr/share/arduino/libraries/synth/tables.h:2023:19: error: variable
‘Env3’ must be const in order to be put into read-only section by means of ‘
attribute((progmem))’
make: *** [.build/uno/src/sketch.o] Error 1I have avr-gcc 4.7.2 installed on debian. which version of avr-gcc are you
using?
Any idea how to fix this?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1
.
I just ran into the same problem. Did you solve it bakad? Can you identify it dzlonline ? I'm using arduino 1.6.0 on OSX. Everything else i've tried to compile has worked so far. Will report back if I find a solution.
I think I've had the same problem, two weeks ago. I've solved it by simply adding the "const" at each var stored in the progmem area, as this page says.
About that, I was wondering why The Synth was not "shaped" like a classic library, with — apart for the table, for which I understand the reason — a .h and a .cpp file?
Many thanks. That makes some sense to me. Perhaps the person who created it is used to a different way of doing things. Perhaps if I learn enough I can get it running like a .h file. Or someone can. Thanks again?
It seems it can run without problem in that way. All the examples I've tried works without problem, other than the "const" one. And knowing not well the C/C++ language, I wonder why Arduino (and other C/C++ tutorials and how-tos) tell us to create a .h and a .cpp, if it can go with just one...
Many thanks!
Jason Nolan, PhD
Associate Professor - Early Childhood Studies
Director - Experiential Design + Gaming Environments (EDGE) Lab
Ryerson University
350 Victoria Street
Toronto Ontario
M5B2K3
EDGE Lab
103N Bell Trinity Square,
483 Bay Street
Toronto, Ontario
On Mar 1, 2015, at 4:49 PM, Pierre-Loup M. notifications@github.com wrote:
I think I've had the same problem, two weeks ago. I've solved it by simply adding the "const" at each var stored in the progmem area, as this page says.
About that, I was wondering why The Synth was not "shaped" like a classic library, with — apart for the table, for which I understand the reason — a .h and a .cpp file?
—
Reply to this email directly or view it on GitHub.
Hi,
I've got the same errors. 2 years ago I have been tweakening with the library and it was working just perfectly!
How can I fix tables.h in order to make the library working?
The compiler gives me back another warning:
tables.h:1745:1: waening: narrowing conversion of '245' from 'int' to 'char' inside { } [-Wnarrowing]
Is this related with th eprevious one?
Hi,
Since there seems to be no problem at line 1745 in table.h, the problem probably comes from the call to this precise value. So the wrong conversion must be in a function that uses it.
Hi trosiemetype,
I'm sorry I didn't specify. The error occurs in an empty sketch with just the #include synth.h. So is related to library itself
troisiemetype,
declaring the waves tables as const worked to you?
Yeah, it worked for the problem specified at the top of this issue. But I don't know if it will solve your problem!
For my use, I've re-written the lib (you can find it in my github repository), modifying tables, functions to suit my needs. I also modified it to run on Atmega 32u2, I don't know if it would work on a Atemga 328. The code is included in it (commented), but I've never tried it. It's been a month i want to clean it, but I cannot find the time to.
I added const type to the wavetables and I can use the library fine (examples are working great), but still appear this warnings:
In file included from /Users/albertocarlassare/Documents/Arduino/libraries/the_synth/synth.h:12:0,
from /Users/albertocarlassare/Documents/Arduino/sketch_may24b/sketch_may24b.ino:1:
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1094:1: warning: narrowing conversion of '128' from 'int' to 'const char' inside { } [-Wnarrowing]
};
^
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '255' from 'int' to 'const char' inside { } [-Wnarrowing]
};
^
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '254' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '254' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '254' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '253' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '253' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '253' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '252' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '252' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '251' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '251' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '250' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '249' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '248' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '248' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '247' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '246' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '245' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '241' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '237' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '232' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '228' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '223' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '219' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '215' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '210' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '205' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '200' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '195' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '189' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '184' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '179' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '173' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '168' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '163' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '157' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '151' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '145' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '139' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1745:1: warning: narrowing conversion of '133' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '255' from 'int' to 'const char' inside { } [-Wnarrowing]
};
^
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '242' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '229' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '216' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '204' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '191' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '178' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '165' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '153' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '142' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:1879:1: warning: narrowing conversion of '134' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '255' from 'int' to 'const char' inside { } [-Wnarrowing]
};
^
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '254' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '254' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '254' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '253' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '253' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '253' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '252' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '252' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '252' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '251' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '251' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '251' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '250' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '250' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '250' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '249' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '249' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '247' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '244' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '242' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '240' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '237' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '235' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '233' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '230' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '219' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '200' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '180' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '160' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2013:1: warning: narrowing conversion of '141' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '255' from 'int' to 'const char' inside { } [-Wnarrowing]
};
^
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '250' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '246' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '242' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '238' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '233' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '229' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '225' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '221' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '217' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '213' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '209' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '206' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '202' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '199' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '195' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '191' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '188' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '183' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '179' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '175' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '170' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '166' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '161' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '157' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '153' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '148' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '144' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '139' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '134' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/albertocarlassare/Documents/Arduino/libraries/the_synth/tables.h:2148:1: warning: narrowing conversion of '130' from 'int' to 'const char' inside { } [-Wnarrowing]
Someone know why i've got this? It is just to clean it. Thanks
I think I got it, but not sure: only values above 127 seem to be concerned about that, so maybe try to replace const char
by const unsigned char
. A char should be between -128 and 127, unsigned char between 0 and 255. So the second would be better for the env[] vars.
That's what I done in my fork of the Synth.
Thank you troisiemetype,
this fixes give me no warning at compiling stafe, I changed all the envelopes to const unsigned char. Still I had a warning about just a SinTable value: 128. I changed SinTable from char to int. Now I have no warnings. I hope this change from char to int doesn't mess the library up.
Thanks again, very useful.
Is it for sinTable or sawTable? In saw table you've got the same kind of problem: It ranges from 128 to -127, where it should be 127 to -128. Just remove 128 at the beginning and add -128 at the end, it should be ok.
Changing the table from char to int could be a problem: it WILL double the size of the table, and 256 bytes is quite a large amount of memory on the Atemga 328. It's better to keep it for anything else, instead of use it just to store one value.
And, there are some trans-typing used in the program, I wonder if it could pose problems...
I have updated the library to accommodate the new way Arduino uses to declare program memory.
Values in the wave tables need to be signed char and range from 127 to -128 and envelope tables need to be char and range from 0 to 255
Regards Dzl
Thanks troisiemetype, you are right about memory usage, I fix as you suggested.
Thank you dzl for the update