This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Disabling warnings Keil

Good day.
I'm trying disable warnings (#2548-D and #69-D).

I have them because i created:
const char a='Ф'; // it is Cyrillic symbol

I wrote "69,2548" in disable Warnings field in Linker tab.

But every time i compile project there are always appear this warnings. What I'm doing wrong?
Thanks!

Parents Reply Children
  • "Yes i know. I use string LCD and Cyrillic symbols have 1 byte code in it. But in windows they are presents in two bytes. I noticed that the main part of symbol code in the second byte and just write it in 1 byte."

    In UTF-8, the Cyrillic characters requires multiple bytes. And you can't strip away some of the leading bytes.

    When using an explicit Cyrillic character set, then the characters fits in a single byte. But that means your editor must work in that character set if you want to see the characters correctly in the source code. And it means that the LCD font must use that same Cyrillic character set.

    In this specific situation - have you investigated what character set the LCD fonts are using? Do they even contain Cyrillic characters?

  • I have additional function that converts character code to code of LCD. I have a table like this:

    ...
    static_cast<char>('Ф'),0xC8,1,
    static_cast<char>('Ð¥'),0x58,0,
    static_cast<char>('Ц'),0xC9,1,
    static_cast<char>('Ч'),0xCA,1,
    static_cast<char>('Ш'),0xCB,1,
    ...
    


    first byte - symbol, second - code in LCD, third - number of page in LCD (it has 2 pages).

  • I tried to use windows 1251 and it works! All symbols now in 1 byte! There are no warning at all!!
    Thank you all for your help!

  • But your code will only work if the code point for the character fits in a char.

    If not, then you need to play with wchar or introduce more advanced code.