|
From: Vincent T. <vt...@un...> - 2010-06-29 10:54:22
|
On Tue, 29 Jun 2010, Greg Chicares wrote: > On 2010-06-29 05:48Z, Vincent Torri wrote: >> >> http://msdn.microsoft.com/en-us/library/xdb9w69d%28VS.71%29.aspx > > That page says "The h, l, and L prefixes are Microsoft extensions when > used with data of type char." > >> to get an unsigned char, i should use "%hc" as modifier (i think that >> "Single-byte" means unsigned char, as "%c" is for char (being signed or >> unsigned)) > > Then you're using a nonstandard extension. > >> then gcc reports that format "%hc" expects type 'short int *' but argument >> 3 has type 'unsigned char *' > > And gcc warns that the code is nonstandard. > >> Am I doing something wrong or is there a bug in header files ? > > If you don't want gcc to give this warning, then inhibit it. What I want is getting an unsigned char. "%hhu" is what should be done on linux. It is not supported by Windows. As I'm porting a linux library to Windows, I'm wondering what to use... Your comments are not quite precise, you even don't answer to my question. regards Vincent Torri |