[opensuse-packaging] Re: [opensuse-project] Procinfo and Procinfo-NG
Cristian Rodriguez wrote:
tabris escribió:
So I'll be looking into those when I get a chance.
good, then we can continue discussion on the opensuse-packaging list, we are offtopic here in -project. ;-)
Ok, I applied the patch provided to my SVN repo http://svn.tabris.net/repos/procinfo-ng/ to trunk/ As to the warnings, they look bogus to me. I'm using int64_t and uint64_t. It looks like to be silence the warnings, I'd need to do any of the following: a) do my own typedefs. blecch, plus might be non-portable. b) use different sprintf statements depending on __WORDSIZE. that's not much better # if __WORDSIZE == 64 typedef long int int64_t; # else __extension__ typedef long long int int64_t; # endif #if __WORDSIZE == 64 typedef unsigned long int uint64_t; #else __extension__ typedef unsigned long long int uint64_t; #endif
tabris
Cristian Rodriguez wrote:
tabris escribió:
So I'll be looking into those when I get a chance.
good, then we can continue discussion on the opensuse-packaging list, we are offtopic here in -project. ;-)
Ok, I applied the patch provided to my SVN repo http://svn.tabris.net/repos/procinfo-ng/ to trunk/
As to the warnings, they look bogus to me.
I'm using int64_t and uint64_t. It looks like to be silence the warnings, I'd need to do any of the following:
I suggest to use:
#include
On Aug 23 2007 09:26, Andreas Jaeger wrote:
I suggest to use: #include
int main (void) { int64_t var;
printf ( PRIi64, var); ... }
The PRT* macros from inttypes.h and the standard integer types from
will do the magic for you,
Bwäh. printf("%llu", (unsigned long long)var); is much more readable and does not provide any surprises. Jan --
* Jan Engelhardt (jengelh@computergmbh.de) [20070823 09:36]:
Bwäh. printf("%llu", (unsigned long long)var); is much more readable and does not provide any surprises.
It isn't more readable and it certainly doesn't provide surprises as stdint.h and inttype.h are ISO C99. Using the widest available type and then doing casts is IMNSHO much uglier. Philipp --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Aug 30 2007 18:32, Philipp Thomas wrote:
* Jan Engelhardt (jengelh@computergmbh.de) [20070823 09:36]:
Bwäh. printf("%llu", (unsigned long long)var); is much more readable and does not provide any surprises.
It isn't more readable and it certainly doesn't provide surprises as stdint.h and inttype.h are ISO C99. Using the widest available type and then doing casts is IMNSHO much uglier.
Ah ok, if the macro expands to %z or %j, very well, but that was not obvious from the macro. Jan -- --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
* Jan Engelhardt (jengelh@computergmbh.de) [20070830 20:42]:
Ah ok, if the macro expands to %z or %j, very well, but that was not obvious from the macro.
No, it dosn't expand to %z or %j >;-), but it will expand to %i, %hhi etc. Just look at the top of /usr/include/stdint.h and you'll see what those macros expand to. Philipp --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (4)
-
Andreas Jaeger
-
Jan Engelhardt
-
Philipp Thomas
-
tabris