On Wed, Apr 3, 2013 at 6:40 AM, Zdenek Styblik <zdenek.styb...@gmail.com> wrote:
> On Tue, Apr 2, 2013 at 9:04 PM, Dan Gora <dan.g...@gmail.com> wrote:
>> Actually I just remembered another reason why I hate the stdint.h types:
>>
>> When compiling on Ubuntu 12.10:
>>
>> ../../lib/ipmi_delloem.c: In function 'ipmi_print_power_consmpt_history':
>> ../../lib/ipmi_delloem.c:4006:13: warning: format '%lld' expects
>> argument of type 'long long int', but argument 2 has type 'uint64_t'
>> [-Wformat]
>>
>
> Dan,
>
> I know exactly what you mean. I've hit the same thing, with different
> project though, on Debian(and Ubuntu comes from Debian).
> Heh. I actually don't know what to write in reply and I had several
> versions already.
> One thing though. If you don't want to use types from 'stdint.h',
> don't. I'm not using all of it and all the time.

I'm willing to change them to be consistent with the other code, but
really I don't use them in new code that I write.

>> So, apparently -Wformat is smart enough to check the type, but not so
>> smart as to be able to check the underlying type, so you get hundreds
>> of errors like these if you use the uint64_t rather than the standard
>> c type 'unsigned long long'.
>
> Isn't u/int64_t, resp. all 64_t, exactly the case where it makes sense
> to use standardized types?

well you can use unsigned long long instead of uint64_t.  This is 64
bits on both 32 and 64 bit machines.  The only types which are
different on 32/64 bit machines are pointers and long/unsigned long
which are 32 bits on 32 bit machines and 64 bits on 64 bit machines.

I think back in the day that 'int' could be 16 bits on some 16 bit
processors, but I don't even think that is true anymore.  At least on
the ATMega64/128, an unsigned int is still 32 bits with gcc.

thanks
dan

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to