Summary, #pragma pack(x) patches

From: Ana Yuseepi (anayuseepi@netscape.net)
Date: Sun Jun 25 2000 - 02:29:02 CDT


****** Message from InterScan E-Mail VirusWall NT ******

** No virus found in attached file noname.htm

***************** End of message ***************

Hello, all, thanks to all, i've not listed down everyone's name,

but i did consider the following answer:
from Brett Lymn, Computer Systems Administrator, BAE SYSTEMS
  I suspect that it has taken effect. I think the problem that you are
  having is more the fact that there are alignment constraints forced by
  the sparc architecture on certain data types. That is, you can only
  load a long word from a long word aligned address. On that basis the
  compiler is doing the correct thing.

  read the long as an array of bytes and assemble them as a long.
  Clunky but it is the only way to get around the data alignment
  constraint.

The original question was:

  hello all, am developing some simple programs on a sparc platform and here
is my difficulties...

the #pragma pack(x) doesn't work even after applying the patches:
107311-10 and 107357-09... but seems that it didn't really take effect.. i
have even rebooted my system... just in case...

  here is the program i tried to run:
  typedef struct _test{
  char a;
  char b;
  long c;
  }test;

  void main(){
  test A;
  printf("%p\n", &A.a);
  printf("%p\n", &A.b);
  printf("%p\n", &A.c);
  }

  effffccc
  effffccd
  effffcd0

  i want it to occupy memory address:
  effffccc
  effffccd
  effffcce

  any idea on how to achieve this?
  -Ana

____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:10 CDT