Hello, I'm using a graphical Display and have a printf() Function which expects an unsigned char pointer: void LCD_DrawString(unsigned char* s); using LCD_DrawString("Hello World"); generates a PC-Lint Warning because the constant string is treated as signed by default. Is there a modifier in c to treat constants like that as unsigned by default like #define 1000U? I'd like to avoid a cast each time I call this Function just to please Lint and on the other Hand I don't want to disable this check in Lint. Regards, Marcus
The macro sounded simple on the first view but isn't really a nice style. Doesn't seem to work with variable Parameter lists either. I also defined my own Types for signed and unsigned 8, 16 and 32 Bit Integer Types to be independent from varying architectures. What bothers me is when I started writing my Code I used my 8bit unsigned type for strings. The Compiler just accepted without any Warning. And for the use of strings it doesn't matter if they default to signed or unsigned so I never questioned. I think your suggestion is in deed the best solution. Treating the standard type char as the Type for strings an characters (without caring for signed or unsigned) somehow never came to my mind :) Thx