Sun Compiler Compatibility with g++

I am new to C++ so I believe this is a basic question.
I was given the job of compiling a C++ program to be compatible with Sun compiler 5.5 Patch 113817-19 2006/10/13 on Solaris 9 Sparc. Since I did not have the Sun One Studio 8 I compiled the program using G++ 3.4.6. Question: will this program compiled with g++ 3.4.6 satisfy the requirements.
Any help would be appreciated.
--Acevez                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

You have to ask those imposing the requirement what they actually care about.
If you need binary compatibility, the answer is "No." Object code produced from C++ source code by any version of Sun C++ cannot be linked with object code produced from C++ source code by any version of g++.
If the requirement is that the source code be successfully compiled by Sun ONE Studio 8 (C++ 5.5), the answer is "maybe." Limitations include the following:
1. Every compiler has bugs. Code might trigger a bug in one compiler but not in a different compiler.
2. g++ has extensions not supported by Sun C++ 5.5. Source code that uses an unsupported extension probably won't work the same (and probably won't compile) with Sun C++ 5.5. If you write code for use with g++, you might not know when you are using a g++ extension.
3. The default version of the C++ Standard Library used by Sun C++ is libCstd, which does not fully conform to the C++ standard. Sun C++ also provides the STLport library as an option. Standard-conforming source code that works with g++ and its libstdc++ might not work with Sun C++ libCstd, but will probably work wtih STLport. If you are not allowed to use STLport with Sun C++ and write code for g++, you might write code that depends on features not supported by libCstd.
In summary, you are asking questions about portability. The short answer is that
A. C++ object code is in general not portable among C++ compilers, and
B. You don't know whether source code is portable until you port it.
That said, most programmers find most of the time that well-written code that has portability in mind works fine with Sun C++.
Finally, Sun Studio 8 is obsolete. It would be better to use the current release, Sun Studio 11, which is free. You can get it here:
http://developers.sun.com/sunstudio
Sun Studio 11 is source and binary compatible with Sun Studio 8, in the following sense:
Valid source code that works with Sun Studio 8 will also work with Sun Studio 11.
Object code produced by Sun Studio 8 can be linked into programs built by Sun Studio 11.
Good luck!

Similar Messages

  • Two compile issues with Sun Studio 12 @ x86(_64 = amd64)

    The following two issues are absent on Solaris 10 SPARC and all previous Sun Studio versions (8 to 11), but present on both amd64 Solaris 10 and Linux 2.6 versions:
    1. mozilla.org's Spidermonkey "JavaScript" (ECMAscript) can't be compiled with it: in file jsinterp.c an endless loop is entered by the optimizer in level -xO1 and higher (!). With no optimization, linking is impossible (unresolved symbols from jsinterp.o), which hints to defunct output.
    2. the optimizer (ube) is crashing in sources with a switch with many many case labels in optimization level -xO3 and higher with a segfault.

    I have trouble to seperate a reasonable (example) source out of our complex sources showing the second issue --- what I can already tell is, that the following special pragma has to do with it (while I'm now in doubt that the each 256 case labels per switch, two switches in an if else clause have to do with it):
    #pragma opt 0 (func_name)
    Own1 Own2 func_name(...)
    The buggy versions I can tell you: they are
    on Solaris 10 amd64:
    /opt/SUNWspro/bin/cc -V
    cc: Sun C 5.9 SunOS_i386 2007/05/03
    /opt/SUNWspro/prod/bin/ube -V
    ube: Sun Compiler Common 12 SunOS_i386 2007/05/03
    on GNU/Linux:
    cc -V
    cc: Sun C 5.9 Linux_i386 2007/05/03
    ube -V
    ube: Sun Compiler Common 12 Linux_i386 2007/05/03
    The only important compiler option in this regard seems to be the optimization level, but the situation is complex too, if others should be also involved. I will investigate further...

  • [svn:fx-trunk] 11488: Resubmitting binary distribution of xercesPatch. jar from the third party module in the SDK and compiled it with Sun JDK 1.4 .2_12.

    Revision: 11488
    Author:   [email protected]
    Date:     2009-11-05 17:10:10 -0800 (Thu, 05 Nov 2009)
    Log Message:
    Resubmitting binary distribution of xercesPatch.jar from the third party module in the SDK and compiled it with Sun JDK 1.4.2_12.
    QE notes: N/A
    Doc notes: N/A
    Bugs:
    SDK-16818 - Must open-source the code for xercesPatch.jar.
    Reviewer: Discussed with Gordon
    Tests run: Checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-16818
    Modified Paths:
        flex/sdk/trunk/lib/xercesPatch.jar
        flex/sdk/trunk/modules/thirdparty/xerces-patch/build.xml

    Did you try this:
    http://forum.java.sun.com/thread.jsp?thread=434718&forum=60&message=1964421

  • Compilation error with RWTValDlist T find() method

    This code used to compile fine with SC 4.x C++ compiler. We are migrating to "Sun WorkShop 6 update 2 C++ 5.3 2001/05/15" and it is now generating the following compilation error:
    ===============================
    cd generic/src; make -f generic.mk
    /opt/SUNWspro/bin/CC -c -PIC -compat -library=rwtools7 -O2 -I. -I. -I../include -I/home/jm/sunos5.8/ib_service_3.4.3/include -I/opt/local/megen/include -I/opt/SUNWspro/WS6U2/include/CC -I../../interface/include -I../include -I. -I/home/jm/sunos5.8/acell_4.1/include -I/opt/local/access/home/include -I/home/jm/sunos5.8/acell_4.1/include/packetcpp -I/home/jm/sunos5.8/acell_4.1/include/ecl -I/home/jm/sunos5.8/acell_4.1/include/gels -I/home/jm/sunos5.8/acell_4.1/src/security/include -I/home/jm/sunos5.8/acell_4.1/include/sequencer -I/home/jm/sunos5.8/acell_4.1/include/gen -I/home/jm/sunos5.8/acell_4.1/include/recipeMgr -I/home/jm/sunos5.8/acell_4.1/include/EFEFeature -I/home/jm/sunos5.8/ib_service_3.4.3/include -I/opt/local/megen/include -I/opt/local/rv/include -I/opt/local/etk/include -I/opt/local/etk/include/tdl -DTCPIP=1 -D__SYSVR4 -DSHOP=1 -D_SOLARIS=1 -I/opt/local/std_comp/include ACEAlarmClock.C
    "ACEAlarmClock.C", line 479: Error: Could not find a match for RWTValDlist<ACEObject*>::find(int(const ACEObject*&,void*), void**, ACEObject*).
    1 Error(s) detected.
    *** Error code 1
    make: Fatal error: Command failed for target `ACEAlarmClock.o'
    ===============================
    The header file in question is:
    #include <rw/tvdlist.h>
    class ACEAlarmClock : public ACEObject
    // The public interface.
    public:
    ACEAlarmClock();
    // Default constructor.
    private:
    static void alarmCallback(void *passAheadRef, ib_alarmid alarmId);
    static RWTValDlist<ACEObject *> AlarmClocks;
    and the source file in question is:
    void
    ACEAlarmClock::alarmCallback(void *passAheadRef, ib_alarmid alarmId)
    ACEObject *object = 0;                        // returned by find()
    if (AlarmClocks.find(findAlarmId, &alarmId, object))
    ACEAlarmClock alarmClock = (ACEAlarmClock )object;
    if (alarmClock)
    AlarmClocks.remove(alarmClock);
    alarmClock->isActive_ = FALSE;
    alarmClock->onAlarm(passAheadRef, alarmId);
    return;
    Any help is highly appreciated. Thanks.
    Cesar Saavedra
    [email protected]

    The C++ Migration Guide that comes with the compiler explains in detail everything you to need to know about migrating from C++ 4.2 to C++ 5.3.
    Use the "-compat" option on every CC command, compiling and linking. Any code that worked with C++ 4.2 will work the same way with C++ 5.3 in compat mode.
    -compat=4 sets language and binary compatibility to that of the 4.x compilers. -compat=5 sets language and binary compatibility to ANSI/ISO standard mode. If the -compat option is not specified, -compat=5 is assumed.
    - Rose

  • JDK 1.5 Serialization Compatibility with assert()

    I have the following class:
    class xyz implements java.io.Serializable {
       void doNothing() {
          int x = 0;
          assert x < 5;
    }If I compile it on both JDK 1.4 (with -source=1.4) and 1.5 (with -source=1.5) platforms, the serialVersion IDs are different. If I comment out the assert statement, the serialVersion on 1.5 platform changes to be the same as the 1.4. If I rebuild the 1.4 with the assert commented out, the serialVersionID does not change.
    Am I missing something here? I have code that needs to be compatible between these versions, but it now seems that the use of assert (other than the statment "assert true") built with 1.5 effects the serialization ID.

    Sure, I can define my own version, but the point is that I've got many fielded classes that have not changed, but now will fail serialization when comunicating with the new system simply because of the use of assertions with 1.5.
    It looks like I will be forced to either go back to 1.4, test all classes for serialization compatibility with 1.4, or remove the asserts from the code.
    In any case, it does not make sence to me why adding an assertion should change the serialVersionUID of a class in the first place when compiling under 1.5 and not under 1.4.

  • Compiler failures with Studio 11 on Solaris 10 x64

    The compiler gives me the following error when I try to compile the larger tests in my environment:
    "Tests.cc", [main]:ube: error: Assert has been violated at '/set/venus_patch/builds.intel-S2/build.0509/intel-S2/lang/ube/opt/src/cfg.c 3150'.
    I am using the following compilation command:
    /opt/SUNWspro/bin/CC -xtarget=opteron -xarch=amd64 -xO0 -library=stlport4 [includes] -c -o obj/lib/Tests.o lib/Tests.cc
    I get a different error if I change the optimization level to 2:
    compiler(iropt) error: connect_labelrefs: undefined label L175 in main
    And yet another message if I use no optimization option at all:
    Assembler: Tests.cc
    "/tmp/yabeAAAX7aqaq", line 20533 : Illegal subtraction in ... ".L209 - .L_y162"
    Failure in /opt/SUNWspro/prod/bin/fbe, status = 0x7f00
    Fatal Error exec'ing /opt/SUNWspro/prod/bin/fbe
    My patches are up to date as of right now, according to smpatch:
    smpatch analyzeNo patches required.
    I am not running compilations in parallel. I have 4 GB free in my swap.
    Any ideas?

    The machine came preinstalled with Solaris 10 and Studio 11. The compiler has been kept up to date by smpatch, as far as I can tell. I remember the update manager installing 120759 and 121018, for example.
    Is this correct?
    comptest> /opt/SUNWspro/bin/CC -V -O hello.cc
    CC: Sun C++ 5.8 Patch 121018-11 2007/05/02
    ir2hf: Sun Compiler Common 11 Patch 120759-14 2007/06/25
    ube: Sun Compiler Common 11 Patch 120759-14 2007/06/25
    /opt/SUNWspro/prod/bin/c++filt: Sun C++ 5.8 2005/10/13
    ccfe: Sun C++ 5.8 Patch 121018-11 2007/05/02
    iropt: Sun Compiler Common 11 Patch 120759-14 2007/06/25
    ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.486
    Thanks for your prompt replies.

  • Compilation problem with templates while using option -m64

    Hi,
    I have compilation problem with template while using option -m64.
    No problem while using option -m32.
    @ uname -a
    SunOS snt5010 5.10 Generic_127111-11 sun4v sparc SUNW,SPARC-Enterprise-T5220
    $ CC -V
    CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
    Here is some C++ program
    ############# foo5.cpp #############
    template <typename T, T N, unsigned long S = sizeof(T) * 8>
    struct static_number_of_ones
    static const T m_value = static_number_of_ones<T, N, S - 1>::m_value >> 1;
    static const unsigned long m_count = static_number_of_ones<T, N, S - 1>::m_count + (static_number_of_ones<T, N, S - 1>::m_value & 0x1);
    template <typename T, T N>
    struct static_number_of_ones<T, N, 0>
    static const T m_value = N;
    static const unsigned long m_count = 0;
    template <typename T, T N>
    struct static_is_power_of_2
    static const bool m_result = (static_number_of_ones<T,N>::m_count == 1);
    template <unsigned long N>
    struct static_number_is_power_of_2
    static const bool m_result = (static_number_of_ones<unsigned long, N>::m_count == 1);
    int main(int argc)
    int ret = 0;
    if (argc > 1)
    ret += static_is_power_of_2<unsigned short, 16>::m_result;
    ret += static_is_power_of_2<unsigned int, 16>::m_result;
    ret += static_is_power_of_2<unsigned long, 16>::m_result;
    ret += static_number_is_power_of_2<16>::m_result;
    else
    ret += static_is_power_of_2<unsigned short, 17>::m_result;
    ret += static_is_power_of_2<unsigned int, 17>::m_result;
    ret += static_is_power_of_2<unsigned long, 17>::m_result;
    ret += static_number_is_power_of_2<17>::m_result;
    return ret;
    Compiation:
    @ CC -m32 foo5.cpp
    // No problem
    @ CC -m64 foo5.cpp
    "foo5.cpp", line 20: Error: An integer constant expression is required here.
    "foo5.cpp", line 36: Where: While specializing "static_is_power_of_2<unsigned long, 16>".
    "foo5.cpp", line 36: Where: Specialized in non-template code.
    "foo5.cpp", line 26: Error: An integer constant expression is required here.
    "foo5.cpp", line 37: Where: While specializing "static_number_is_power_of_2<16>".
    "foo5.cpp", line 37: Where: Specialized in non-template code.
    "foo5.cpp", line 20: Error: An integer constant expression is required here.
    "foo5.cpp", line 43: Where: While specializing "static_is_power_of_2<unsigned long, 17>".
    "foo5.cpp", line 43: Where: Specialized in non-template code.
    "foo5.cpp", line 26: Error: An integer constant expression is required here.
    "foo5.cpp", line 44: Where: While specializing "static_number_is_power_of_2<17>".
    "foo5.cpp", line 44: Where: Specialized in non-template code.
    4 Error(s) detected.
    Predefined macro:
    @ CC -m32 -xdumpmacros=defs foo5.cpp | & tee log32
    @ CC -m64 -xdumpmacros=defs foo5.cpp | & tee log64
    @ diff log32 log64
    7c7
    < #define __TIME__ "09:24:58"
    #define __TIME__ "09:25:38"20c20
    < #define __sparcv8plus 1
    #define __sparcv9 1[snipped]
    =========================
    What is wrong?
    Thanks,
    Alex Vinokur

    Bug 6749491 has been filed for this problem. It will be visible at [http://bugs.sun.com] in a day or two.
    If you have a service contract with Sun, you can ask to have this bug's priority raised, and get a pre-release version of a compiler patch that fixes the problem.
    Otherwise, you can check for new patches from time to time at
    [http://developers.sun.com/sunstudio/downloads/patches/]
    and see whether this bug is listed as fixed.

  • Generics bug in Sun compiler?

    The code show compiles using the oracle compiler, but when executed generate a NoSuchMethodError. Apparently, this doesn't occur when run under Eclipse, presumably compiled byJikes. Is this a known bug? (Compiled using 1.6.0_21)
    public class Bug  {
        public static void main(String[] args) {
            X x = new X();
            x.da();
        public static interface A {
            void foo();
        public static interface B {
            void bar();
        public static class FooBar implements A, B {
            @Override public void foo() {
            @Override public void bar() {
        public static class Z<T extends A & B, TT extends T> {
            final TT t;
            public Z(final TT t) {
                this.t = t;
            void da() {
                    t.foo();
                    t.bar();
        public static class X extends Z<FooBar, FooBar> {
            public X() {
                super(new FooBar());
    }Exception in thread "main" java.lang.NoSuchMethodError: com.iontrading.anvil.tradelibrary.bus.Bug$A.bar()V
         at com.iontrading.anvil.tradelibrary.bus.Bug$Z.da(Bug.java:40)
         at com.iontrading.anvil.tradelibrary.bus.Bug.main(Bug.java:8)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)

    rxcolvin wrote:
    Apparently, this doesn't occur when run under Eclipse, presumably compiled byJikes.Minor correction: Eclipse doesn't use Jikes (and as far as I know never did). They do have their own compiler however (called simply the Eclipse Java Compiler). ECJ is written in Java, as opposed to Jikes, which is written in C++.
    Edit: confirmed to be broken with javac from the Sun JDK (6u22) and the OpenJDK 1.6.0_20. Works when compiled with the Eclipse compiler (both with conformance 1.5 and 1.6) from an up-to-date Eclipse 3.6.1.
    It wouldn't be the first time that ECJ gets something right that javac doesn't compile correctly.

  • [svn] 3050: Removed compile warning with JDK1.5

    Revision: 3050
    Author: [email protected]
    Date: 2008-08-29 16:48:58 -0700 (Fri, 29 Aug 2008)
    Log Message:
    Removed compile warning with JDK1.5
    Modified Paths:
    blazeds/trunk/modules/core/src/java/flex/messaging/io/BeanProxy.java

    Did you try this:
    http://forum.java.sun.com/thread.jsp?thread=434718&forum=60&message=1964421

  • CAPS compatability with third party application servers

    hi all,
    can anybody know what are various application servers are compatable with CAPS projects deployment. please let me know whether can i deploy a CAPS project in JBOSS application server. is JBOSS compatable wiht CAPS project? if yes, please let me clear what are the prerequisite we need to do to deploy a CAPS project in JBOSS application server.
    Thanks
    rss

    As per Sun Product Services: Unfortunately, no, that is not possible yet. JBoss is on our list of app-servers to support but it presently isn't supported. You should be able to use JCAPS Integration Server.

  • Do anybody know, if there is a roadmap of Suns compiler as OSS?

    Hi!
    I have read at
    http://www.heise.de/newsticker/result.xhtml?url=/newsticker/meldung/90435
    that Sun plans to publish version 12 of Sun Studio for Linux and Solaris free of charge on 4.6.2007 at
    http://developer.sun.com/sunstudio
    This also then includes again its C/C++ and Fortran Compiler for Linux and Solaris.
    I have also heard, that Sun plans to make its compiler, with which (Open)Solaris is compiled, also OpenSource.
    Do you know, if it is right, that Suns compiler will be OpenSource in the future?
    And do you know, if there existing a roadmap, in which year this will be?
    Greatings
    theuserbl

    http://forum.java.sun.com/thread.jspa?threadID=5179230

  • How can I turn off compatibility with 7.1 when labview 8 converts my 7.1 code?

    Hi,
    I just loaded LV8 on my mac. It converted/compiled my app code to 8. While doing that, it changed many of my constants to hidden controls to maintain combabtibility with 7.1. I really don't care about 7.1 anymore. Is there a way to turn this off so I can re-compile the code and keep it the way it is?
    Obviously, I am new to LV but I don't see a reason for keeping the compatibility with 7.1 if my lab is going to 8.
    Any thoughs, comments, or critisims would be appreciated.
    tarek316

    The particular issue you're talking about isn't necessarily "compatibility" with LabVIEW 7.1...it's actually ensuring that your VIs behave the same in 8.0 as they did in 7.1.  As described in that dialog box, a change was made in LabVIEW 8.0 regarding how VI diagrams are compiled in regards to Case Structures with cases that will never run.  If you are using case structures with constants wired to their selectors purely to keep VIs in memory at particular points in your code, then you should heed the advice given in the context help for the created control and use a Static VI Reference in your code instead of a subVI in a case structure.  If you are using case structures with constants wired to their selectors to comment out code, perhaps you should use the Diagram Disable structure instead.
    -D 
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Is Oracle IDM compatable with IE 8??

    Hi All,
    Is Oracle IDM compatable with IE 8??
    Thanks & Regards,
    Siva Pokuri.

    Browser      Microsoft Internet Explorer      6.0 SP2 with Sun Java Plug-in 1.4.2      Windows clients      9.1.0, 9.0.3, 9.0.1      
    6.0 SP2 with Sun Java Plug-in 1.6.0_07      Windows clients      9.1.0.1 or later
    7.0 with Sun Java Plug-in 1.4.2      Windows clients      9.1.0, 9.0.3, 9.0.1      
    7.0 with Sun Java Plug-in 1.6.0_07      Windows clients      9.1.0.1 or later
    If you see doc, it will show you above certification.
    But I don think that it shld sm different behavior with 8.0. Are you facing any issue ?

  • Windows 8 and itunes 11 compatibility with an ipod

    I have itunes11 and Windows 8. I've called Apple and I've talked to Microsoft. This was months ago. I can download itunes and run it from my laptop but am unable to sync my ipod. I get an error and it automatically reboots my computer. I was told there were known compatibility with itunes and Windows 8.  This was months ago.
    I know how to downgrade itunes to XP or Win 7. This is not the issue. I can download to my laptop and place, it will not sync to my ipod device (which is a fear years old), but when I did talk to support I was told that it was supported. The ipod was not the issue.. It was the incompatibility between the programs.
    I see recent updates in the support community in the past month about production resolution but this still has not resolved my issue. I don't believe purchasing a new ipod is going to resolve the issue either.
    If anyone has successfully developed a workaround or recently downloaded itunes11 w/ Windows 8 and can sync to an apple ipod I would love to know how you did it.
    Kia
    [email protected]

    Im not sure that will solve the issue I have with itunes. I have a lenovo laptop and I think it's just an issue with Apple who has to modify the program for users of Windows 8 so that itunes can be used and to find purchased music. I found the music I purchased through itunes but it's not the full tracks. It said it allows me to download it fully so I can hear the whole track, but needs some kind of capatibility? I have no idea what the problem is. If someone has the answer knowing my computer brand and having windows 8 compatibility issues, please let me know what you suggest.

  • Is adobe photoshop cs2 compatable with windows 8?

    Is adobe photoshop CS2 compatable with windows 8?

    I have removed and re-installed CS2 twice now and still get the same library application error.
    DO NOT INSTALL WINDOWS 8 ONTO YOUR COMPUTER IF YOU WANT TO KEEP CS2!
    Telling us to spend more money to upgrade our software to meet OS does not show trust to the users. CS2 should be able to work with new OS systems and if not users should be allowed to update their current program for free to be able to use it on the new OS.
    Thank you,
    Eric

Maybe you are looking for

  • Error :  While applying the Patch 4440000

    Error :  While applying the Patch 4440000 FAILED: file igwprop.odf on worker  1 for product igw username IGW. When i check the worker log file i got this error The sequence IGW_AWARDS_S in the database is defined as: MINVALUE = 1 MAXVALUE = 214748364

  • Issue in retrival of Old Appraisal system template

    Dear Expert, landscape :ecc 6 , business package 1.41 Currently i am facing a problem in ESS/MSS regarding extracting old appraisal template.the scenario is currently old and new (objective setting and appraisal ) both are available at server . i act

  • SSO login page in local language

    I am developing J2EE web application and will secure it using JAAS and SSO on Oracle IAS 10g. I would like to customize SSO so login JSP page labels and error messages are displayed in local language. In order to avoid hard coding of labels and error

  • Animated gif is not moving in the FireFox 3.6.3 ?

    why animated gif is not moving in FireFox 3.6.3 ? == This happened == Every time Firefox opened

  • Difference b/w Read and SynchRead in FTP Adapter

    Hi All, I wanted to know the difference b/w read and synchread in FTPAdapter. Thanks.