#274 #pragma syntax error with Sun Studio 11

0.65
open
None
5
2012-09-07
2006-10-14
laurent
No

I get the following erreor when building xms.cpp using
Sun Studio 11:

source='xms.cpp' object='xms.o' libtool=no \ DEPDIR=.deps depmode=none /bin/bash ../../depcomp \ CC -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include
-I/usr/X11/include -I/opt/games/dosbox/include
-I/opt/games/dosbox/include/SDL -D_GNU_SOURCE=1
-D_REENTRANT -xarch=amd64a -DDISABLE_JOYSTICK -c -o
xms.o xms.cpp
"../../include/dos_system.h", line 222: Warning: String
literal converted to char in initialization.
"xms.cpp", line 78: Error: Syntax error in pragma.
"xms.cpp", line 78: Error: Missing ')' in #pragma.
"xms.cpp", line 78: Error: Syntax error in pragma.
"xms.cpp", line 93: Error: Syntax error in pragma.
"xms.cpp", line 93: Error: Missing ')' in #pragma.
"xms.cpp", line 93: Error: Syntax error in pragma.
6 Error(s) and 1 Warning(s) detected.
** Error code 6
make: Fatal error: Command failed for target `xms.o'

I avoided it by putting a statement to ignore the
pragma, but I'm no C++ programmer, I wouldn't know if
that's right:

if ! defined(__sun)

Not much help from the documentation:
http://docs.sun.com/source/819-3690/Pragmas_App.html

Dosbox then builds and starts, but with an issue (c:
says the drive is not mounted, even though the mount c
/path was done successfully).

Discussion

  • Peter Veenstra
    Peter Veenstra
    2006-10-15

    Logged In: YES
    user_id=535630

    try changing
    pragma (push,1)
    to
    pragma pack(1)
    and pragma pop
    to pragma pack()

    pragmas are used with visual C

    xms has little has to do with mounting though.
    So that is probably a different problem although it is quite
    debugable.

     
  • laurent
    laurent
    2006-10-15

    Condition to use different pragmas with Sun Studio

     
    Attachments
  • laurent
    laurent
    2006-10-15

    Logged In: YES
    user_id=1447460

    Ok, done, this builds nicely with both GCC and Studio. I've
    attached the modification I've done in case you want to put
    it in.

    I'm going to open a separate bug for the mounting issue.