¿ªÔÆÌåÓý

Re: Bitx40 Pavel's blend sketch updated (the Allard's folk one with S-Meter, TX-meter, AGC)


Jack Purdum
 

That is really odd, as I just compiled it with 1.8.3 and I get warnings without using the const qualifier. You're referring to the sample program I just posted?

Jack, W8TEE



From: Vince Vielhaber <vev@...>
To: [email protected]
Sent: Wednesday, August 2, 2017 9:55 AM
Subject: Re: [BITX20] Bitx40 Pavel's blend sketch updated (the Allard's folk one with S-Meter, TX-meter, AGC)


Here's the odd part.? I'm using 1.8.3 and it compiles cleanly without the
need for const.


Archiving built core (caching) in:
/tmp/arduino_cache_983837/core/core_arduino_avr_uno_58fdfaf47d105b38e1c8ebee0e7fc37d.a
Sketch uses 20150 bytes (62%) of program storage space. Maximum is 32256
bytes.
Global variables use 1288 bytes (62%) of dynamic memory, leaving 760 bytes
for local variables. Maximum is 2048 bytes.


Vince.



> Hi Jonathan:
> The problem stems from the definition of the model[] array. The new parser
> tightens things up a bit, as illustrated in the following program:
> void setup() {???? const char *model[] = {" LSB", " USB", " CWL", " CWU"};
> ?? ?? // Use this line, no warning???? // char *model[] = {" LSB", " USB",
> " CWL", " CWU"}; ?? ?? ?? ??// Use this line, deprecated warning
> ?? char test[4];
> ?? Serial.begin(9600);?????? strcpy(test, model[1]);??
> Serial.println(test);??}
> void loop() {}
> The problem is caused by not using the const type qualifier when you
> define a variable that has an initializer list like the code does above.
> Try running the sample program toggling the two definitions for model[].
> Given the way I've used the array (in strcpy()), it's ok to ignore the
> warning.
> Jack, W8TEE
>
>? ? ? From: jrea79 via Groups.Io <jrea79=[email protected]>
>? To: [email protected]
>? Sent: Wednesday, August 2, 2017 8:30 AM
>? Subject: Re: [BITX20] Bitx40 Pavel's blend sketch updated (the Allard's
> folk one with S-Meter, TX-meter, AGC)
>
> hi!
>
> when i try compile it has this message:
>
> C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:194:48: warning: deprecated
> conversion from string constant to 'char*' [-Wwrite-strings]????char
> *model[] = {" LSB", " USB", " CWL", " CWU"};???? ?? ?? ?? ?? ?? ?? ?? ??
> ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??
> ^??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:194:48: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:194:48: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:194:48: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:269:17: warning: deprecated
> conversion from string constant to 'char*' [-Wwrite-strings]????char
> *BARCHAR = "="; ?? ??// char to show on the bar???? ?? ?? ?? ?? ?? ?? ??
> ??^??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]????};????^??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*'
> [-Wwrite-strings]??C:\Users\James\AppData\Local\Temp\Temp1_bitx40-master
> (3).zip\bitx40-master\bitx40\bitx40.ino:692:1: warning: deprecated
> conversion from string constant to 'char*' [-Wwrite-strings]
> what's going on? please help thanks!
>
> 73!
> jonathan / DV2NAH
>
>
>
> |? | Virus-free. www.avast.com? |
>
>


--
? Michigan VHF Corp.? ?
? ? ? ? ? ? ?







Join [email protected] to automatically receive all group messages.