[ros-kernel] some patches to fix some warnnings
ekohl at rz-online.de
Fri Nov 14 13:38:36 CET 2003
"Jonathan Wilson" <jonwil at tpgi.com.au> wrote:
> Firstly, I dont know very much about printf format specifiers (or more
> specificly these advanced ones)
> I dont know why changing these things to fix the warnings is not an
Simply because Microsoft does not support the 'll' prefix for 64bit types.
They are using 'I64' instead. If you replace 'I64' by 'll' the driver,
utility or application will only run on ReactOS but it won't run (properly)
on Windows. I do not think this is part of our plan.
> Dont blame me for doing this, I am just doing what kjk_hyperion said I
> should do to make the warnings go away.
I'm not blaming anyone, neither you, nor hyperion.
> And BTW, both the %ll and the %.*ls fixes have been verified my myself
> (i.e. that they print out what they should print in as many of the places
> in the code where they are used as is possible)
Yes, they work on ReactOS but not on Windows! Btw, the use of '%*ls' will
crash the app if the pointer to the UNICODE_STRING is NULL. If '%wZ' is
used, printf() will check for a NULL pointer and print '<NULL>' instead of
> I dont care that GCC doesnt like %i64 and will warn about it. All I know
> kjk_hyperion said to use %ll and that it makes the warning go away, is
> standard and as far as I can tell, still prints out the correct value.
> with %.*ls
Okay, '%ll' is part of the C standard. But Microsoft does *_NOT_* implement
this part of the C standard because they supported 64bit variables long
before the standard (C99) was established.
> If you can suggest a solution that:
> 1.doesnt require modifying anything outside of the ROS code e.g. gcc
> that would take probobly take ages to get through the system and into use
> plus there is always the problem of people not upgrading)
> and 2.doesnt require me removing -Wall -Werror from anywhere
> Then, I am happy to implement implement it.
No, I can not provide a sollution that satisfies your demands other than
adding -Wno-format. But this will disable format checks entirely. You will
have to choose between two evils.
> Otherwise, I just want to get this patch out of my tree and into CVS so
> that ROS can become 100% warning free and stay that way (because of the
> -Werror meaning that people have to write warning free code)
I don't want to step on your toes but maybe you should just drop your patch
and ask other developers to fix 'their' code.
More information about the Ros-kernel