Warnings when i use uart component

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times
Contact:

Warnings when i use uart component

Post by Alkaline »

Hi

When i use a component like uart or gsm, during the compilation the compiler return me the following warnings

2G.c:3121:3: warning: passing argument 1 of 'FCD_047b1_UART1__ReceiveString' discards 'volatile' qualifier from pointer target type [enabled by default]
FCV_ANSWER[0] = FCV_RECEINVE[5];
^
2G.c:967:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
//Local variable definitions
^
2G.c:3130:3: warning: passing argument 1 of 'FCD_0ee11_gLCD_ILI9341__Print' discards 'volatile' qualifier from pointer target type [enabled by default]
mainendloop: goto mainendloop;
^
2G.c:1812:6: note: expected 'MX_CHAR *' but argument is of type 'volatile MX_CHAR *'
MX_UINT8 FCL_POS_STR;
^


the problem is both using the GSM component and the uart component.

These warnings multiply when you enter more lines of code.

In programs with many lines of code the warnings also appear for simple delays :shock: or for comments :shock: .
Attachments
2G.fcfx
(16.34 KiB) Downloaded 206 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Warnings when i use uart component

Post by Benj »

Hello,
discards 'volatile' qualifier
Is a warning you can safely ignore. We tag variables as volatile to ensure that any changes to the variable value are written back to the variable location.

We do the same thing for PIC16, PIC8 and AVR devices and these compilers do not generate the warnings.

I've had a quick look through the compiler manual to see if we can maybe hide the warnings or even generate the correct code for the compiler but so far I haven't spotted the option to allow me to do this.

Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times
Contact:

Re: Warnings when i use uart component

Post by Alkaline »

Hi Benj

Thanks for the reply.
These warnings appear when I introduce a conversion from int to char.

For example, if I try to print the number on the display (macro check answer, second if), then there is a conversion from value to character, it generates the warning.

However, if I do not have to print in this case the warning is not generated

Note:
this software works if the file system.h (https://www.microchip.com/SWLibraryWeb/ ... %20Library)

Otherwise, just remove the check mark from use supplementary code and disable the first icon
Attachments
2G.fcfx
(24.29 KiB) Downloaded 189 times

bernoulli
Posts: 22
Joined: Sat Dec 12, 2015 10:18 am
Has thanked: 1 time
Contact:

Re: Warnings when i use uart component

Post by bernoulli »

Are there plans to update the compiler to eliminate these error messages? This will help everyone tremendously.

Thank you,

Gary

Post Reply