Trouble Shooting Via Error Codes in Keil 5

I am a newbie for about ten years now, off and on, so I've forgotten so much. I do my Build in Keil for the TI Launchpad Board and I get, on a horizontal pane, at the bottom , a list of warnings and error codes that I cannot make any sense of. First of all, Warnings aren't, that I know of , going to stop a Build. In my case however, I'm getting a tsunami of warnings that bury my one or two errors like a needle in a haystack. I have no idea why keil does that, mingling errors with warnings. Can I suppress the warnings for now, so I have a chance at trouble shooting the errors ? I did find a listing of error codes that attempts, in chart form, to demystify the error codes which, to me at least are so cryptic I haven't a clue what they mean. Here is an example of what I mean, with a warning. I cannot even find the errors. To me this is just meaningless ... 

C:/Users/Binky/AppData/Local/Arm/Packs/ARM/CMSIS-DSP/1.14.4/Source/TransformFunctions/arm_cfft_radix2_init_q31.c(138): warning: cast from 'const unsigned short *' to 'unsigned short *' drops const qualifier [-Wcast-qual]
S->pBitRevTable = (uint16_t *) & armBitRevTable[7];

Parents
  • Can I suppress the warnings for now, so I have a chance at trouble shooting the errors ?

    https://community.arm.com/support-forums/f/keil-forum/56058/how-does-one-disable-warnings-during-the-build-process-in-keil-5

    I'm getting a tsunami of warnings that bury my one or two errors like a needle in a haystack. I have no idea why keil does that, mingling errors with warnings.

    I think most (all?) compilers do that - they give the messages in the order they find the issues.

    GCC is the same.

    Warnings aren't, that I know of , going to stop a Build

    Sometimes a warning can lead to an error later in file - so it's generally best to address messages in order, starting from the first one reported.

    An example here: https://community.st.com/t5/stm32-mcus-products/conflicting-types-error/m-p/686823/highlight/true#M252539

    To me this is just meaningless ... 

    C:/Users/Binky/AppData/Local/Arm/Packs/ARM/CMSIS-DSP/1.14.4/Source/TransformFunctions/arm_cfft_radix2_init_q31.c(138): warning: cast from 'const unsigned short *' to 'unsigned short *' drops const qualifier [-Wcast-qual]
    S->pBitRevTable = (uint16_t *) & armBitRevTable[7];

    So in this line:

    S->pBitRevTable = (uint16_t *) & armBitRevTable[7];

    You are performing a cast - you are telling the compiler to ignore the actual type of armBitRevTable[7], and take it as if its type were  uint16_t

    The compiler is warning you that, in doing so, your are ignoring the fact that armBitRevTable[7] was declared as const.

    Presumably, it was declared as const for a reason - so the compiler is just alerting you to the fact that you are ignoring that.

    Declaring something as const indicates that the thing should never be written to, and allows the compiler to detect potential errors if you do try to write to it. By throwing away that const, you are opening yourself up for such errors to go undetected - hence the compiler warns you.

Reply
  • Can I suppress the warnings for now, so I have a chance at trouble shooting the errors ?

    https://community.arm.com/support-forums/f/keil-forum/56058/how-does-one-disable-warnings-during-the-build-process-in-keil-5

    I'm getting a tsunami of warnings that bury my one or two errors like a needle in a haystack. I have no idea why keil does that, mingling errors with warnings.

    I think most (all?) compilers do that - they give the messages in the order they find the issues.

    GCC is the same.

    Warnings aren't, that I know of , going to stop a Build

    Sometimes a warning can lead to an error later in file - so it's generally best to address messages in order, starting from the first one reported.

    An example here: https://community.st.com/t5/stm32-mcus-products/conflicting-types-error/m-p/686823/highlight/true#M252539

    To me this is just meaningless ... 

    C:/Users/Binky/AppData/Local/Arm/Packs/ARM/CMSIS-DSP/1.14.4/Source/TransformFunctions/arm_cfft_radix2_init_q31.c(138): warning: cast from 'const unsigned short *' to 'unsigned short *' drops const qualifier [-Wcast-qual]
    S->pBitRevTable = (uint16_t *) & armBitRevTable[7];

    So in this line:

    S->pBitRevTable = (uint16_t *) & armBitRevTable[7];

    You are performing a cast - you are telling the compiler to ignore the actual type of armBitRevTable[7], and take it as if its type were  uint16_t

    The compiler is warning you that, in doing so, your are ignoring the fact that armBitRevTable[7] was declared as const.

    Presumably, it was declared as const for a reason - so the compiler is just alerting you to the fact that you are ignoring that.

    Declaring something as const indicates that the thing should never be written to, and allows the compiler to detect potential errors if you do try to write to it. By throwing away that const, you are opening yourself up for such errors to go undetected - hence the compiler warns you.

Children