[uClinux-dev] #pragma pack() in user mode

munix munikn at myw.ltindia.com
Thu Mar 6 22:07:50 EST 2003



HI ALL,

Can any one help me out abt how "#pragma pack()" works in uclinux , and how
to go abt to use it... in user mode
I want ot use it, to pack the structure from padding
Iam getting compilation error.

Thanx in advance
Munix


-------Original Message-------

From: uclinux-dev at uclinux.org
Date: Thursday, March 06, 2003 03:58:21 AM
To: uClinux-dev
Subject: [uClinux-dev] BIG numbers more info...

OK... here's some more code:


#include <stdio.h>
#include <stdlib.h>

int main(void)
{
unsigned long long llInt = 83;
char str_long[40] = "358505772769";
printf("16: %llu\n", llInt<<16);
printf("30: %llu\n", llInt<<30);
printf("32: %llu\n", llInt<<32);
llInt = 22022;
if((83ll << 32) ==0) printf ("ZERO\n");
else printf("NON ZERO\n");
llInt += 38ll<<32;
printf("foo: %llu\n", llInt);
printf("foo: %llu\n", (llInt/100000));
llInt = atoll(str_long);
printf("str: %llu\n", llInt );
printf("str: %llu\n", (llInt/100000) );
return 0;
}

on Linux workstation:

ranttine at tossu:~/src/module/module> ./test.exe
16: 5439488
30: 89120571392
32: 356482285568
NON ZERO
foo: 163208779270
foo: 1632087
str: 358505772769
str: 3585057

on uCdimm:

# /mnt/test.gdb
16: 5439488
30: 3221225472
32: 0
NON ZERO
foo: 22022
foo: 1632087
str: 2023487201
str: 3585057

...so it looks like it can handle these long long values, but just can't
print 'em out... OK, I think I can now work my way around this by making
my own string handling function, but it would be nice to be able to use
just the normal library funcions.

And, BTW I use the old uc-libc... can't use uClibc, because it has way
too unreliable signal handling.

/Roope


_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20030306/bc27ca09/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMSTP.gif
Type: image/gif
Size: 494 bytes
Desc: not available
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20030306/bc27ca09/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2377_img.jpg
Type: image/jpeg
Size: 16756 bytes
Desc: not available
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20030306/bc27ca09/attachment.jpg>


More information about the uClinux-dev mailing list