Hi there,
I am getting some very strange errors using #pragma pack on Solaris 7,
and can't for the life of me see what I am doing wrong. The code that
I am compiling compiles and runs okay on Solaris 2.x. I am compiling C++
code using Sun's CC compiler (oddly enough, all the c files that I
compile up with the cc compiler, using exactly the same #pragma
directives, works. I am using Visual WS C++/Sparc 3.0 on Solaris 7
(whereas I was using WS Compiler C/C++/SPARC 4.2 on Solaris 2.x). On
Solaris 7, I am also running in 32-bit mode (although I don't think this
should make a difference) - I haven't yet had a chance to try it in
64-bit mode. Is there anyone out there that can give me some idea of what
I might be doing wrong - or is there a problem with this version of
compiler on Solaris 7.
The following error messages occur when I try to compile the code in
question:
line 250: Error: Syntax error in pragma.
line 250: Error: Missing ')' in #pragma.
Line 250 reads: #pragma pack()
This line, as far as I am aware, should remove the effects of the
previous pack(1) line. It seems that the pack pragma does not like
having no arguments, even though all the doc that I have says this is
valid. So, why isn't this working!?
Any help would be very much appreciated. Many thanks in advance,
Blake Evans-Pritchard
--
All opinions expressed above are my own. They may not necessarily
be those of my employer, IBM.