[Tinyos-help] help needed on uint64_t type

Eric Decker cire831 at gmail.com
Thu Feb 5 13:43:37 PST 2009


I don't think the tinyos printf handles 64 bit objects.

eric


On Thu, Feb 5, 2009 at 1:32 PM, BAI LI <libai0915 at gmail.com> wrote:

> Hi All,
>
> I just tested it. I guess prinf couldn't print 64 bits variables but low 32
> btis instead. By moving the  variable 32 bits left, it can print the high 32
> bits. such as a>>32. it made the debugging work a bit harder but still ok.
> Anyone kowns how to print the whole variable instead breaking it into two
> parts. Let me know. Thanks.
>
> Regards,
> Bai
>
> On Thu, Feb 5, 2009 at 5:56 PM, kiseop Lee <acorrd at gmail.com> wrote:
>
>> Hi,
>> This is tested in Visual C++ in the Windows. but I don't know it in tinyos
>> compiler.
>> Only refer to your work...
>>
>>  char sql[100];
>>
>> __int64 var1=0x12345678ABCDABCD;
>>  sprintf(sql,"%I64x",var1);   //not L. Upper case of i[ai]...
>> sprintf(sql,"%I64d",var1);
>>
>> Best regards,
>> K.S.Lee
>>
>>  2009/2/5 BAI LI <libai0915 at gmail.com>
>>
>>> Hi All,
>>>
>>> I have defined a uint64_t type variable as follows:
>>>
>>> uint64_t a;
>>> a=0x0000FFFFFFFFFFFF;
>>> printf("a= %lld /n",a);
>>> printf("a= %llx /n",a);
>>>
>>> the result displayed as follows:
>>>
>>> a= -1
>>> a= ffffffff
>>>
>>> The compilation didn't show any error. What is the problem? Does printf
>>> support to display the uint64_t type? Any help would be appreciated!
>>>
>>> Regards,
>>> Bai
>>>
>>>
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> Tinyos-help at millennium.berkeley.edu
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>
>>
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Jack Baskin School of Engineering
UCSC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090205/ab78f089/attachment.htm 


More information about the Tinyos-help mailing list