[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2096.0. "cc does not allow #pragma pack to be used in a non-global scope?" by TUXEDO::LU () Tue Feb 18 1997 14:58

I am using DEC C (Digital Unix Compiler Driver 3.11) on OSF1 V3.2 62 alpha.

1 foo()
2 {
3 #pragma pack(4)
4    struct my_struct {
5	char a;
6	...
7    };
    ...
}

When compile the above code using cc, the following errors occur.

/usr/lib/cmplrs/cc/cfe: Error : ..., line 3: Syntax Error
 __pragma(4, 4);
 ^

/usr/lib/cmplrs/cc/cfe: Error: ..., line 4: Syntax Error
   struct my_struct {
___^

Interesting enough, cxx has no problems with the same code.

Any insight will be appreciated.

-James

T.RTitleUserPersonal
Name
DateLines
2096.1QUARRY::metskyI'm hysterical and I'm wetTue Feb 18 1997 15:304
You're using the old ucode C compiler (acc).  To use DEC C on DIGITAL UNIX
V3.2 you need to use the -migrate option.

 -dave-
2096.2Try cc -migrateDECCXL::WIBECANThat's the way it is, in Engineering!Tue Feb 18 1997 15:377
Under Unix V3.2, are you using cc -migrate?  Without the -migrate switch, you
would be using the older acc compiler, rather than DEC C.

A test on a handy V3.2 system confirms that the error appears under acc and
disappears with cc -migrate.

						Brian