I have used this:
cont uint8_t *x[] = { "a", "b" }
compiler don't generate warning but UV4.70 has warning flag on left side "initializing const uint8_t * with an expression of type char[] converts b/w pointer to inetegr of different sign"
How to avoid this.
errors in your snippet.
"cont" should likely be "const"
"a" and "b" are strings, not integers.
it is possible that even a consultant would notice these faults.
More accurately, "a" and "b" are strings which are comprised of chars, not integers.
sorry about my lack of capitalization, but I'm lazy sorry about my lack of punctuation, but I'm lazy sorry about my lack of C language knowledge, but I'm lazy sorry about my lack of attention to detail, but I'm lazy sorry about my dumbassed comment about consultants, but I'm a dumbass
sorry about the mimicry. looks like the comment about consultants struck a nerve.
good!
sorry about all the above. after friday's welfare check, saturday is the day for bath salts
ho. my original response was technically correct (or at least, not incorrect) and most of the mimicry that followed was rather lacking in correctness.
that nerve must have been raw. great!
any following post purporting to be (or in any way suggesting they are) me is a fake.
Can some one provide way to remove warning:
const uint8_t *my_data[] = { {""}, {"INT"}, {"SIN"}, {"AXI"}, {"CON"}, {"ST "}, {"NOR"}, {"..."},
};
warning: braces around scaler initializer
warning: ..............(As I written in original post)
Here the second warning:
"initializing const uint8_t * with an expression of type char[] converts b/w pointer to inetegr of different sign"
So - does your project run with signed or unsigned char type? Is "hello" a C string of signed or unsigned characters?
So don't do that, then!!
sir i have removed braces. what about other warning. i don't understand what per asked
Strings are comprised of characters (char type), not small integers. Use a char array for strings. Use a uint8_t array to hold small unsigned integers.
#include <stdio.h> const char * const Texts[] = { "Text-INT", "Txt-SIN", "Tx-AXI" }; int main(void) { }
Tested with Windows XP, Code::Blocks 10.05
Note that Code::Blocks is an IDE. And it supports a large set of different compilers - gcc is just one of many.