Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!rothen From: rothen@unix.cis.pitt.edu (Seth B Rothenberg) Newsgroups: comp.lang.c Subject: COMMONS in C Message-ID: <22944@unix.cis.pitt.edu> Date: 18 Mar 90 20:07:28 GMT Reply-To: rothen@unix.cis.pittsburgh.edu (Seth B Rothenberg) Distribution: usa Organization: Western Psychiatric Institute & Clinic Lines: 29 I am trying to convert a fortran code-generator into a C code-generator. I think I have worked out a scheme for commons, but I was recently told something that casts some doubt on my idea. I was thinking that a common could be converted into a structure e.g., COMMON TEST /A/B/C/ INTEGER A,B,C becomes struct st_com_TEST { int A,B,C; }; extern struct st_com_TEST *com_TEST; I have actually tried this on the vax and it worked. But someone told me recently that the order of the variables in memory is not always the same as the order of the variables in the structure. Is this true? Based on the way structures can be initialized, I think the person I spoke with is mistaken. I would appreciate any comments. Thanks Seth Rothenberg rothen@unix.cis.pitt.edu