¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

complile errors


 

ctrl-c worked just didn't think it di before.


file compiles now with the below warnings i guess they are.? do they need to be corrected or is it good the way it is?

dave k7da



Equalizer.cpp: In function 'void SetEqualizerBands()':
Equalizer.cpp:220: warning: 'position' may be used uninitialized in this function
???? rxEqualizer[j] = position;

????????????????????????????? ^

C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino: In function 'int SetFilterCenterFrequency(int, int, int)':

C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino:622:19: warning: variable 'delta' set but not used [-Wunused-but-set-variable]

?? int coordinate, delta, increment, target;

?????????????????? ^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:78:48: note: #pragma message: Compiling for Teensy 3.X...

?? #pragma message("Compiling for Teensy 3.X...")

??????????????????????????????????????????????? ^

In file included from C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:79:0:

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:104:66: note: #pragma message: Using Ports B&D - pins should be connected to:

? #pragma message("Using Ports B&D - pins should be connected to:")

^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:106:89: note: #pragma message: DB_0=16, DB_1=17, DB_2=19, DB_3=18, DB_4=0, DB_5=1, DB_6=29, DB_7=30

? #pragma message ("DB_0=16, DB_1=17, DB_2=19, DB_3=18, DB_4=0, DB_5=1, DB_6=29, DB_7=30")

^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:110:92: note: #pragma message: DB_8=2, DB_9=14, DB_10=7, DB_11=8, DB_12=6, DB_13=20, DB_14=21, DB_15=5

? #pragma message ("DB_8=2, DB_9=14, DB_10=7, DB_11=8, DB_12=6, DB_13=20, DB_14=21, DB_15=5")

^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:111:91: note: #pragma message: If using a display with an 8-bit bus, use connections to DB_8 to DB_15

? #pragma message ("If using a display with an 8-bit bus, use connections to DB_8 to DB_15")

^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT_Buttons\UTFT_Buttons.cpp: In member function 'void UTFT_Buttons::deleteAllButtons()':

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT_Buttons\UTFT_Buttons.cpp:199:19: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

?? buttons[i].label="";

?????????????????? ^

Opening Teensy Loader...

Sketch uses 210536 bytes (20%) of program storage space. Maximum is 1048576 bytes.
Global variables use 35676 bytes (13%) of dynamic memory, leaving 226468 bytes for local variables. Maximum is 262144 bytes.


James Zdunic
 

Since the message indicates the teensy loader was activated I believe the compiler is happy. I am getting the same (or very similar) messages when I compile and am able to load it into the teensy board. However I can¡¯t speak in regards to functionality since I have not yet finished the build.

Jim KM4TXR

On Jan 27, 2019, at 7:11 PM, k7da <k7da@...> wrote:

ctrl-c worked just didn't think it di before.


file compiles now with the below warnings i guess they are. do they need to be corrected or is it good the way it is?

dave k7da



Equalizer.cpp: In function 'void SetEqualizerBands()':
Equalizer.cpp:220: warning: 'position' may be used uninitialized in this function
rxEqualizer[j] = position;

^

C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino: In function 'int SetFilterCenterFrequency(int, int, int)':

C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino:622:19: warning: variable 'delta' set but not used [-Wunused-but-set-variable]

int coordinate, delta, increment, target;

^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:78:48: note: #pragma message: Compiling for Teensy 3.X...

#pragma message("Compiling for Teensy 3.X...")

^

In file included from C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:79:0:

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:104:66: note: #pragma message: Using Ports B&D - pins should be connected to:


 

Once again, the warning in yellow below is caused by this statement block:

int SetFilterCenterFrequency(int scaleStart, int ScaleEnd, int whichOne)
{
? char temp[4];
? int coordinate, delta, increment, target;

? increment = 50;
? target??? = 700;

? switch (whichOne) {?????????????? // Drawing for which filter?
??? case CWFILTER1:
????? target = cwCenterFrequency;
????? delta = 200;
????? break;

??? case CWFILTER3:
????? target = ssbCenterFrequency;
????? delta = 1000;
????? break;
// More lines....


As you can see, the error message is bogus, delta is set, but within a switch/case statement block and the GNU compiler does not parse it correctly. The #pragma errors can also be ignored. Besides, they are in libraries and, even though I could correct them, it's not my library.

If you have a previous install of the Teensyduino, you need to uninstall it, download the latest version and install it. The reason is because a number of libraries we use are those provided by the Teensy, not Adafruit. Read all of the documents before you try to install any of the software. It will say you time in the long run.

Jack, W8TEE


On Sunday, January 27, 2019, 7:22:07 PM EST, James Zdunic <james_zdunic@...> wrote:


Since the message indicates the teensy loader was activated I believe the compiler is happy.? I am getting the same (or very similar) messages when I compile and am able to load it into the teensy board.? However I can¡¯t speak in regards to functionality since I have not yet finished the build.

Jim KM4TXR

> On Jan 27, 2019, at 7:11 PM, k7da <k7da@...> wrote:
>
> ctrl-c worked just didn't think it di before.
>
>
> file compiles now with the below warnings i guess they are.? do they need to be corrected or is it good the way it is?
>
> dave k7da
>
>
>
> Equalizer.cpp: In function 'void SetEqualizerBands()':
> Equalizer.cpp:220: warning: 'position' may be used uninitialized in this function
>? ? ? rxEqualizer[j] = position;
>
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
>
> C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino: In function 'int SetFilterCenterFrequency(int, int, int)':
>
> C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino:622:19: warning: variable 'delta' set but not used [-Wunused-but-set-variable]
>
>? ? int coordinate, delta, increment, target;
>
>? ? ? ? ? ? ? ? ? ? ^
>
> C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:78:48: note: #pragma message: Compiling for Teensy 3.X...
>
>? ? #pragma message("Compiling for Teensy 3.X...")
>
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
>
> In file included from C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:79:0:
>
> C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:104:66: note: #pragma message: Using Ports B&D - pins should be connected to:
>




 

Again, the GNU compiler isn't smart enough to see that position below is set.

????? position = rxEqualizer[j];
????? if (position < 160)??????????????? // Don't overshoot/undershoot
??????? position = 160;
????? if (position > 358)
??????? position = 358;

Clearly, it is set in line 203 and then reset by the if blocks.

You can correct all the warnings if you want to, but there is no reason to. First, the person who writes the library should be the one who maintains it. That person simply hasn't kept up with the compiler changes. Second, if you do correct them, then you are out of sync with everyone else, making support much more difficult, if not impossible. Warnings should not stop a compile/upload.

Jack, W8TEE


On Sunday, January 27, 2019, 7:11:57 PM EST, k7da <k7da@...> wrote:


ctrl-c worked just didn't think it di before.


file compiles now with the below warnings i guess they are.? do they
need to be corrected or is it good the way it is?

dave k7da



Equalizer.cpp: In function 'void SetEqualizerBands()':
Equalizer.cpp:220: warning: 'position' may be used uninitialized in this
function
???? rxEqualizer[j] = position;

????????????????????????????? ^

C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino: In function
'int SetFilterCenterFrequency(int, int, int)':

C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino:622:19: warning:
variable 'delta' set but not used [-Wunused-but-set-variable]

?? int coordinate, delta, increment, target;

?????????????????? ^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:78:48: note:
#pragma message: Compiling for Teensy 3.X...

?? #pragma message("Compiling for Teensy 3.X...")

??????????????????????????????????????????????? ^

In file included from
C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:79:0:

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:104:66:
note: #pragma message: Using Ports B&D - pins should be connected to:

? #pragma message("Using Ports B&D - pins should be connected to:")

^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:106:89:
note: #pragma message: DB_0=16, DB_1=17, DB_2=19, DB_3=18, DB_4=0,
DB_5=1, DB_6=29, DB_7=30

? #pragma message ("DB_0=16, DB_1=17, DB_2=19, DB_3=18, DB_4=0, DB_5=1,
DB_6=29, DB_7=30")

^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:110:92:
note: #pragma message: DB_8=2, DB_9=14, DB_10=7, DB_11=8, DB_12=6,
DB_13=20, DB_14=21, DB_15=5

? #pragma message ("DB_8=2, DB_9=14, DB_10=7, DB_11=8, DB_12=6,
DB_13=20, DB_14=21, DB_15=5")

^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:111:91:
note: #pragma message: If using a display with an 8-bit bus, use
connections to DB_8 to DB_15

? #pragma message ("If using a display with an 8-bit bus, use
connections to DB_8 to DB_15")

^

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT_Buttons\UTFT_Buttons.cpp:
In member function 'void UTFT_Buttons::deleteAllButtons()':

C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT_Buttons\UTFT_Buttons.cpp:199:19:
warning: ISO C++ forbids converting a string constant to 'char*'
[-Wwrite-strings]

?? buttons[i].label="";

?????????????????? ^

Opening Teensy Loader...

Sketch uses 210536 bytes (20%) of program storage space. Maximum is
1048576 bytes.
Global variables use 35676 bytes (13%) of dynamic memory, leaving 226468
bytes for local variables. Maximum is 262144 bytes.





 

Jack,

The first compiler warning says that 'delta' is set but not used.? Looking at the function it appears that is true.? I don't see where 'delta' is used after it's set.

Brian - N8BDB?

On Sun, Jan 27, 2019 at 9:34 PM jjpurdum via Groups.Io <jjpurdum=[email protected]> wrote:
Once again, the warning in yellow below is caused by this statement block:

int SetFilterCenterFrequency(int scaleStart, int ScaleEnd, int whichOne)
{
? char temp[4];
? int coordinate, delta, increment, target;

? increment = 50;
? target??? = 700;

? switch (whichOne) {?????????????? // Drawing for which filter?
??? case CWFILTER1:
????? target = cwCenterFrequency;
????? delta = 200;
????? break;

??? case CWFILTER3:
????? target = ssbCenterFrequency;
????? delta = 1000;
????? break;
// More lines....


As you can see, the error message is bogus, delta is set, but within a switch/case statement block and the GNU compiler does not parse it correctly. The #pragma errors can also be ignored. Besides, they are in libraries and, even though I could correct them, it's not my library.

If you have a previous install of the Teensyduino, you need to uninstall it, download the latest version and install it. The reason is because a number of libraries we use are those provided by the Teensy, not Adafruit. Read all of the documents before you try to install any of the software. It will say you time in the long run.

Jack, W8TEE


On Sunday, January 27, 2019, 7:22:07 PM EST, James Zdunic <james_zdunic@...> wrote:


Since the message indicates the teensy loader was activated I believe the compiler is happy.? I am getting the same (or very similar) messages when I compile and am able to load it into the teensy board.? However I can¡¯t speak in regards to functionality since I have not yet finished the build.

Jim KM4TXR

> On Jan 27, 2019, at 7:11 PM, k7da <k7da@...> wrote:
>
> ctrl-c worked just didn't think it di before.
>
>
> file compiles now with the below warnings i guess they are.? do they need to be corrected or is it good the way it is?
>
> dave k7da
>
>
>
> Equalizer.cpp: In function 'void SetEqualizerBands()':
> Equalizer.cpp:220: warning: 'position' may be used uninitialized in this function
>? ? ? rxEqualizer[j] = position;
>
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
>
> C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino: In function 'int SetFilterCenterFrequency(int, int, int)':
>
> C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino:622:19: warning: variable 'delta' set but not used [-Wunused-but-set-variable]
>
>? ? int coordinate, delta, increment, target;
>
>? ? ? ? ? ? ? ? ? ? ^
>
> C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:78:48: note: #pragma message: Compiling for Teensy 3.X...
>
>? ? #pragma message("Compiling for Teensy 3.X...")
>
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
>
> In file included from C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:79:0:
>
> C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:104:66: note: #pragma message: Using Ports B&D - pins should be connected to:
>





--
¡°si vis pacem, para bellum¡±

--
Brian - N8BDB


 

Jack,

Sorry, that was the second compiler warning, not the first.

The first warning is correct as well.? If the condition ('digitalRead(FILTERENCODERSWITCH) != LOW') is false when first evaluated, execution falls through to the MyDelay() call.? execution then uses the uninitialized position variable in the statement flagged by the compiler.??

Brian - N8BDB


On Sun, Jan 27, 2019 at 11:39 PM Brian Bowling via Groups.Io <bowlingb=[email protected]> wrote:
Jack,

The first compiler warning says that 'delta' is set but not used.? Looking at the function it appears that is true.? I don't see where 'delta' is used after it's set.

Brian - N8BDB?

On Sun, Jan 27, 2019 at 9:34 PM jjpurdum via Groups.Io <jjpurdum=[email protected]> wrote:
Once again, the warning in yellow below is caused by this statement block:

int SetFilterCenterFrequency(int scaleStart, int ScaleEnd, int whichOne)
{
? char temp[4];
? int coordinate, delta, increment, target;

? increment = 50;
? target??? = 700;

? switch (whichOne) {?????????????? // Drawing for which filter?
??? case CWFILTER1:
????? target = cwCenterFrequency;
????? delta = 200;
????? break;

??? case CWFILTER3:
????? target = ssbCenterFrequency;
????? delta = 1000;
????? break;
// More lines....


As you can see, the error message is bogus, delta is set, but within a switch/case statement block and the GNU compiler does not parse it correctly. The #pragma errors can also be ignored. Besides, they are in libraries and, even though I could correct them, it's not my library.

If you have a previous install of the Teensyduino, you need to uninstall it, download the latest version and install it. The reason is because a number of libraries we use are those provided by the Teensy, not Adafruit. Read all of the documents before you try to install any of the software. It will say you time in the long run.

Jack, W8TEE


On Sunday, January 27, 2019, 7:22:07 PM EST, James Zdunic <james_zdunic@...> wrote:


Since the message indicates the teensy loader was activated I believe the compiler is happy.? I am getting the same (or very similar) messages when I compile and am able to load it into the teensy board.? However I can¡¯t speak in regards to functionality since I have not yet finished the build.

Jim KM4TXR

> On Jan 27, 2019, at 7:11 PM, k7da <k7da@...> wrote:
>
> ctrl-c worked just didn't think it di before.
>
>
> file compiles now with the below warnings i guess they are.? do they need to be corrected or is it good the way it is?
>
> dave k7da
>
>
>
> Equalizer.cpp: In function 'void SetEqualizerBands()':
> Equalizer.cpp:220: warning: 'position' may be used uninitialized in this function
>? ? ? rxEqualizer[j] = position;
>
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
>
> C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino: In function 'int SetFilterCenterFrequency(int, int, int)':
>
> C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino:622:19: warning: variable 'delta' set but not used [-Wunused-but-set-variable]
>
>? ? int coordinate, delta, increment, target;
>
>? ? ? ? ? ? ? ? ? ? ^
>
> C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:78:48: note: #pragma message: Compiling for Teensy 3.X...
>
>? ? #pragma message("Compiling for Teensy 3.X...")
>
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
>
> In file included from C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:79:0:
>
> C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:104:66: note: #pragma message: Using Ports B&D - pins should be connected to:
>





--
¡°si vis pacem, para bellum¡±

--
Brian - N8BDB



--
¡°si vis pacem, para bellum¡±

--
Brian - N8BDB


 

You're right...I didn't look to the end of the function. It appears it can be deleted. I'm not sure why I added it...

Jack, W8TEE

On Sunday, January 27, 2019, 11:39:27 PM EST, Brian Bowling <bowlingb@...> wrote:


Jack,

The first compiler warning says that 'delta' is set but not used.? Looking at the function it appears that is true.? I don't see where 'delta' is used after it's set.

Brian - N8BDB?

On Sun, Jan 27, 2019 at 9:34 PM jjpurdum via Groups.Io <jjpurdum=[email protected]> wrote:
Once again, the warning in yellow below is caused by this statement block:

int SetFilterCenterFrequency(int scaleStart, int ScaleEnd, int whichOne)
{
? char temp[4];
? int coordinate, delta, increment, target;

? increment = 50;
? target??? = 700;

? switch (whichOne) {?????????????? // Drawing for which filter?
??? case CWFILTER1:
????? target = cwCenterFrequency;
????? delta = 200;
????? break;

??? case CWFILTER3:
????? target = ssbCenterFrequency;
????? delta = 1000;
????? break;
// More lines....


As you can see, the error message is bogus, delta is set, but within a switch/case statement block and the GNU compiler does not parse it correctly. The #pragma errors can also be ignored. Besides, they are in libraries and, even though I could correct them, it's not my library.

If you have a previous install of the Teensyduino, you need to uninstall it, download the latest version and install it. The reason is because a number of libraries we use are those provided by the Teensy, not Adafruit. Read all of the documents before you try to install any of the software. It will say you time in the long run.

Jack, W8TEE


On Sunday, January 27, 2019, 7:22:07 PM EST, James Zdunic <james_zdunic@...> wrote:


Since the message indicates the teensy loader was activated I believe the compiler is happy.? I am getting the same (or very similar) messages when I compile and am able to load it into the teensy board.? However I can¡¯t speak in regards to functionality since I have not yet finished the build.

Jim KM4TXR

> On Jan 27, 2019, at 7:11 PM, k7da <k7da@...> wrote:
>
> ctrl-c worked just didn't think it di before.
>
>
> file compiles now with the below warnings i guess they are.? do they need to be corrected or is it good the way it is?
>
> dave k7da
>
>
>
> Equalizer.cpp: In function 'void SetEqualizerBands()':
> Equalizer.cpp:220: warning: 'position' may be used uninitialized in this function
>? ? ? rxEqualizer[j] = position;
>
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
>
> C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino: In function 'int SetFilterCenterFrequency(int, int, int)':
>
> C:\JackaLSourceCode\JackAl_Ver0.91a\JackAl_Ver0.91a.ino:622:19: warning: variable 'delta' set but not used [-Wunused-but-set-variable]
>
>? ? int coordinate, delta, increment, target;
>
>? ? ? ? ? ? ? ? ? ? ^
>
> C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:78:48: note: #pragma message: Compiling for Teensy 3.X...
>
>? ? #pragma message("Compiling for Teensy 3.X...")
>
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
>
> In file included from C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\UTFT.cpp:79:0:
>
> C:\Arduino1.8.8\hardware\teensy\avr\libraries\UTFT\hardware/arm/HW_Teensy3.h:104:66: note: #pragma message: Using Ports B&D - pins should be connected to:
>





--
¡°si vis pacem, para bellum¡±

--
Brian - N8BDB


 

Jack,
Conversationally speaking about why you added it.
You are limiting position to between 160 and 358.? I'm guessing it was your intent to store the limited value back into?rxEqualizer[j]
so it's within your limits the next loop around and stored that way with the EEPROM.put

You used the var position for clarity writing and reading the code, but could have just used? rxEqualizer[j]?

Rgds,
Gary