LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LStrPrintf signedness warning in CIN app

So is there a way to to send "type anything you want" as unsigned char data instead of char?

 

I know U can build a struct, and force data to be signed or unsigned, but for a string inside quotes in something like sprintf and similar is there a way toforce it?

0 Kudos
Message 11 of 13
(558 Views)

Yes find the compiler flag that tells the compiler to use unsigned character strings as default. Visual C uses for this /J which is best used when compiling code to link with LabVIEW headers.

 

Or admittedly considered very ugly by most, typecast the string constant to an unsigned character string specifically

 

(CStr)"This is any string treated as unsigned char array!"

 

If the typecast is uglier than the warning message you have to decide yourself. I personally think C compilers complaining about this with default warning level, are a bit over the top.

Message Edited by rolfk on 11-24-2009 10:39 PM
Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 13
(557 Views)

Are you using .cpp or .c?

 

I had problem with .cpp before with LStrPrintf.  Change to .c solve all the problem.

 

 

George Zou

 

George Zou
0 Kudos
Message 13 of 13
(538 Views)