Page 1 of 1

Warnings when i use uart component

Posted: Mon Sep 09, 2019 4:49 pm
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: .

Re: Warnings when i use uart component

Posted: Tue Sep 10, 2019 11:30 am
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.

Re: Warnings when i use uart component

Posted: Wed Sep 11, 2019 1:49 pm
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

Re: Warnings when i use uart component

Posted: Fri Oct 15, 2021 12:36 am
by bernoulli
Are there plans to update the compiler to eliminate these error messages? This will help everyone tremendously.

Thank you,

Gary