Warning (Anachronism)

Hi all,
I'm getting the following compiler warning in certain cases:
Warning (Anachronism): Formal
argument 3 of type extern "C" void*(*)(void*) in call to
pthread_create(unsigned*, const pthreadattr*,
extern "C" void*(*)(void*), void*) is being passed void*(*)(void*).
This happens when the C function I'm calling (in this case pthread_create()), expects a function as a parameter. The function I am passing it is a normal global function. The warning is coming from me not declaring my function as extern "C". What are the consequences of this warning? I've never had any problems ignoring it, but maybe there could be some... Am I safe to ignore?
Thanks!

Hi,
Has anyone figured this problem out ? I am getting the same warning (using C++ 5.0 and pthread.h).
Please post answers.
Thanks
Farid
Hi all,
I'm getting the following compiler warning in certain
cases:
Warning (Anachronism): Formal
argument 3 of type extern "C" void*(*)(void*) in
n call to
pthread_create(unsigned*, const pthreadattr*,
extern "C" void*(*)(void*), void*) is being passed
d void*(*)(void*).
This happens when the C function I'm calling (in this
case pthread_create()), expects a function as a
parameter. The function I am passing it is a normal
global function. The warning is coming from me not
declaring my function as extern "C". What are the
consequences of this warning? I've never had any
problems ignoring it, but maybe there could be some...
Am I safe to ignore?
Thanks!

Similar Messages

  • Sun Studio 11 "Warning (Anachronism)"

    Hello,
    Compiling a C++ program using Sun Studio 11 compiler on Solaris, I get warnings like this:
    Warning (Anachronism): Using blabla(*)(<params>) to initialize extern "C" blabla(*)(<params>).
    For example, this happens passing a callback of type jvmtiHeapObjectCallback to IterateOverHeap (both defined in Sun's jvmti.h):
    typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
    (jlong class_tag, jlong size, jlong* tag_ptr, void* user_data);
    jvmtiError (JNICALL IterateOverHeap) (jvmtiEnv env,
    jvmtiHeapObjectFilter object_filter,
    jvmtiHeapObjectCallback heap_object_callback,
    const void* user_data);
    What does this warning mean?
    I checked that JNICALL is defined in Solaris jni_md.h as empty string, so it seems strange for me that the compiler wants extern "C" here.
    The same code compiles with no problems on Solaris with gcc, as well as with Visual Studio on Windows and with gcc on Linux and Mac.
    Best regards,
    Anton

    Thank you for your prompt reply.
    In the guide, it is said:
    "The Sun implementation of C and C++ function linkage is binary-compatible. That is not the case with every C++ implementation, although it is reasonably common".
    I believe that for all other platforms that we support - Linux, Mac OS X, Windows - the only difference in C and C++ linkage is C++ name mangling.
    I'm not 100% sure (just curious, do you know any implementations where C and C++ functions are not linkage compatible?), but there never were runtime problems with such C/C++ function mixing in our code.
    Actually, the mixing happens in our code because we declare class with single static function (callback implemetation) right in the function where function requiring callback parameter is used. This is similar to Java anonymous classes, and helps to write simpler code (especially when callback code is short, and there are many different callbacks in different places of the code):
    void qqq() {
    struct Tmp {
    static void myCallback() { ... }
    foo(&Tmp::myCallback);
    So, unfortunately, the offered solutions (wrapping) will not work in our case, unless we simply rewrite our callbacks as regular C functions.
    Is there a compiler option (or a pragma) to suppress this warning?

  • Warning on Sun

    I was having trouble since long time removing some of the warnings
    from my file which was builted on Solaris 9 using C++ compiler 5.0.3.
    Your help would be highly appreciated.
    Warning message is :
    Warning (Anachronism): Formal argument destroy_value_func of type
    extern "C" void(*)(Void *) in call to g_hash_table(extern "C" unsigned
    (*)(const void*),extern "C" int(*)(const void*,const void*),extern "C"
    void (*)(void*),extern "C" void (*)(void*)) is being passed
    void(*)(void*).
    This kind of several warnings I am getting.
    Thanks,

    There is no C++ 5.0.3 compiler version. Run the command
    CC -V
    to find out the compiler version. But the compiler version does not matter for this question.
    The "Anachronism" warnings are explained in the C++ MIgration Guide that comes with the compiler. This particular warning is explained in section 3.11, "Pointers to extern C Functions". To find the Migration Guide, point your browser to <install-dir>/docs/index.html and follow the links. By default, <install-dir> is /opt, but your compiler might be installed somewhere else. You can also find the Migration Guide on http://docs.sun.com
    Brief answer:
    In standard C++, the function linkage is part of the type of a function and of a pointer to function. A pointer to a C-linkage function is not compatible with a pointer to a C++-linkage function, even if the signatures are the same.
    On many C++ implementations, the calling sequence of C and C++ linkage functions is the same, so the code will actually work. But the warning is there to tell you that the code is not portable. The Migration Guide explains several ways you can fix your code to make it valid and portable.

  • Sun Studio 11 do not parse make output and create link to file?

    Hi,
    Running Sun Studio 11 and can only get file links in the output window when I run a make command that uses CC -g (debug option). We have integrated other tools into our make system (flexlint, cppUnit..) and even though we make sure that the syntax is exactly the same as the compiler output and matches regular expression under tools->options->building->make settings->error expression, it doesn't work. Why do you have to debug compile to get sun studio to create a file link in the output window? Doesn't sun studio just parse the text from the make command?
    example of flexlint output for which no link is created:
    "/vobs/project/oss/fm/fm4/fm-fmalib/fmbal/fmaaulib/src/FMA_List.cc", line 440: Error 84: sizeof object is zero or object is undefined'�
    example of make debug output for which we do get a link:
    "/vobs/project/oss/fm/fm4/fm-fmalib/fmbal/SunOS5.10/inc/FMA_alarm_record.hh", line 1310: Warning (Anachronism):Info "static" is not allowed and is being ignored.
    Regards,
    Ola

    I'd second Maxim's suggestion: try NetBeans 5.5 with C/C++ Development Pack. The official release of NetBeans C/C++ Development Pack 5.5 has happened a few days ago. You can download it from
    http://www.netbeans.info/downloads/all.php?b_id=2284
    Some of the changes between the beta3 build and FCS are:
    * Significant performance improvements in the code parser resulting in faster results in the Class View and Code Completion
    * Programs now run in an external terminal (system dependent) by default. This allows better input control
    * Significant performance improvement in the debugging module
    * Significant functionality improvement in the debugging module
    * New project type "C/C++ Project From Existing Code" which simplifies creating a project from existing code
    * Macro support in code completion
    * Hyperlink navigation for macro usages and #include directives
    * Reformat code
    * Code folding
    * Code completion
    All these features will appear in next Sun Studio release, so you can
    consider NetBeans C/C++ Development Pack 5.5 as a preview of new
    Sun Studio IDE.

  • Template template parameters don't work

    Consider the following code:
    #include <iostream>
    #include <algorithm>
    template <template <typename T, int I> class Container, typename type, int size>
    struct ContainerTraits
         typedef typename Container<type, size>::type value_type;
    template <typename T, int N>
    class MyContainer
         public:
              typedef T type;
              static const int SIZE = N;
              T* begin() { return data; }
              T* end() { return data+N; }
              T &operator[](int index) { return data[index]; }
         private:
              T data[N];
    template <template <typename T, int I> class Container, typename type, int size>
    void fillZeroContainer(Container<type, size> c)
         typedef ContainerTraits<Container, type, size> CTraits;
         typedef typename CTraits::value_type value_type;
         std::fill(c.begin(), c.end(), value_type(0));
    int main()
         MyContainer<float, 4> c;
         fillZeroContainer(c);
         std::cout << c[0] << std::endl;
         // Once the rest of the code compiles, try to uncomment this.
    //      float array[int(c[0]) + 2];
    //      array[0] = 0;
         return 0;
    Compiling yields:
    $ g++ -Wall sunCCproblem.cc
    $ sunCC sunCCproblem.cc
    "sunCCproblem.cc", line 40: Warning: The variable c has not yet been assigned a value.
    "sunCCproblem.cc", line 30: Error: Template template-parameter Container<T, I> requires a class template argument.
    "sunCCproblem.cc", line 40: Where: While instantiating "fillZeroContainer<MyContainer<float, 4>, float, 4>(MyContainer<float, 4>)".
    "sunCCproblem.cc", line 40: Where: Instantiated from non-template code.
    "sunCCproblem.cc", line 7: Warning (Anachronism): Using Container as a template without a declaration.
    "sunCCproblem.cc", line 31: Where: While specializing "ContainerTraits<MyContainer<float, 4>, float, 4>".
    "sunCCproblem.cc", line 31: Where: Instantiated from fillZeroContainer<MyContainer<float, 4>, float, 4>(MyContainer<float, 4>).
    "sunCCproblem.cc", line 40: Where: Instantiated from non-template code.
    1 Error(s) and 2 Warning(s) detected.
    This is Sun Studio 12 (x86) on Linux AMD64 (ubuntu).
    I think it is a bug in the compiler. GCC and Intel have no problem compiling this code.
    If that is not correct, please let me know what shold be corrected to make the code compile.
    Thanks in advance,
    F. Beekhof

    This problem was filed as CR 6639155, which you can view at
    [http://bugs.sun.com]
    This bug appears not to have been fixed yet.
    If your problem appears to be the same, you can vote for the bug. If not, you can file a new bug report.
    If you have a support contract with Sun, you can escalate the bug to get a fix sooner. You could also get the fix before it is officially released in a patch. You can find out about support contracts here:
    [http://developers.sun.com/sunstudio/support/index.jsp]

  • Multdecl error in algorithm.cc /w SS C++ 5.12

    Howdy,
    I am running into trouble with multiple declaration errors in the libCstd algorithim.cc file while trying to compile a C++ file. I'm hoping somebody has a clue.
    Background - I am trying to port a library that was originally written using GNU C++ on Solaris to Sun Studio C++ on Solaris. To make a long story short, this library needs to be linked with a program that was already written for Sun Studio C++. Since I've been told you can't mix and match GNU and Sun C++ code together, I'm trying to recompile this library using Sun Studio C++. Recompiling the program with GNU C++ is not an option for various technical and political reasons. Recompiling the library is the only option at this time.
    Version - CC: Sun C++ 5.12 SunOS_sparc 2011/11/16
    ~/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/prod/bin/CC -DNDEBUG -KPIC -g -DNO_MEMBER_TEMPLATES -c -I../../include -I../base -I../parser -I../dc -errtags -c DcPeerManager.cpp
    "../parser/DiameterAVP.h", line 99: Warning, wvarhidemem: length hides DiameterAVP::length.
    "../base/ObjectQueue.h", line 91: Warning, incompletew: The type "DcEvent", used in delete, is incomplete.
    "../base/ObjectQueue.h", line 185: Warning, incompletew: The type "DcEvent", used in delete, is incomplete.
    "DcEvent.h", line 107: Warning (Anachronism), assumetemp: Using ObjectQueue as a template without a declaration.
    "/home/dmd/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/prod/include/CC/Cstd/algorithm.cc", line 908: Error, multdecl: Multiple declaration for __stl_threshold.
    "/home/dmd/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/prod/include/CC/Cstd/algorithm.cc", line 1082: Error, multdecl: Multiple declaration for __stl_chunk_size.
    I looked at algorithm.cc and could not find these alleged multiple declarations. The problem must lie elsewhere but I really have no clue what is causing it.
    Does anybody have any ideas of how to troubleshoot this?
    TIA

    There are several things that could be wrong.
    First, check to see if algorithm.cc is explictly included anywhere. If so, change the code so that it only uses a standard include directive:
    #include <algorithm> One possible subtle problem involves the compiler's default behavior in including files having template code. By default, if a template is declared in a header file and is used, the compiler looks for a corresponding .cc (or .cpp, .C, etc) file, and includes it automatically. If the source code was not written with automatic inclusion in mind, you can get duplicate definition errors due to multiple inclusion of the same file.
    You can read more about the "definitions-included" and "definitions-separate" template compilation model in the C++ Users Guide, chapter 5, "Program Organization".
    However, I don't see how this feature could result in multiple declarations from algorithm.cc, unless the project source code tries to be clever about standard headers, such as including a preprocessed standard header. That is, something like this:
    % cat foo.cc
    #include <algorithm>
    % CC -E foo.cc > algo.h  # don't do this!
    % cat myproject.cc
    #include "algo.h" // don't do this
    ...First, check for something odd like the above. If that's not the problem, try adding the option
    -template=no%extdef
    to disable the automatic inclusion of source code files.
    If still no joy, please post a small sample program that results in the same error messages.

  • Wrong IR type: 27???

    Solaris 10, Solstudio12.2, qt-4.7.1
    Looking through the documentation, and googling was not helpful. Am I looking at an
    iropt bug?
    /opt/solstudio12.2/bin/CC -c -I../../mkspecs/solaris-cc -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I.rcc/release-shared -I../3rdparty/xorg -Iimage -I/usr/sfw/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs -I.moc/release-shared -I/usr/openwin/share/include -I.uic/release-shared -I/usr/sfw/include -D_REENTRANT -DNDEBUG -D__EXTENSIONS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS -DSOLARIS10 -DNO_DEBUG -D_UNICODE -DUNICODE -D_RWSTD_REENTRANT -D_XOPEN_SOURCE=500 -D_XPG5 -I/opt/kde4/include/stdcxx/ansi -I/opt/kde4/include/stdcxx/tr1 -I/opt/kde4/include/stdcxx -I/opt/kde4/include -xtarget=pentium4 -m32 -xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8 -library=no%Cstd -library=Crun -features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplr efstatic -instances=global -template=geninlinefuncs -s -xdebugformat=dwarf -xlang=c99 -xalias_level=compatible -xustr=ascii_utf16_ushort -Qoption ccfe -features=gcc -Qoption ccfe -features=zla -Qoption ccfe ++boolflag:sunwcch=false -mt -L/opt/kde4/lib -R/opt/kde4/lib -library=no%Cstd -library=Crun -lstdcxx4 -I/usr/include/libpng14 -I/opt/kde4/include -I/opt/kde4/include/glib-2.0 -I/opt/kde4/lib/glib-2.0/include -I/opt/webstack/mysql/5.1/include/mysql -I/usr/X11/include -I/usr/postgres/8.3/include -I/opt/kde4/include/dbus-1.0 -I/opt/kde4/dbus-1.0/include -I/usr/X/include -mt -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_REENTRANT -DNDEBUG -D__EXTENSIONS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS -DSOLARIS10 -DNO_DEBUG -D_UNICODE -DUNICODE -D_RWSTD_REENTRANT -D_XOPEN_SOURCE=500 -D_XPG5 -I/opt/kde4/include/stdcxx/ansi -I/opt/kde4/include/stdcxx/tr1 -I/opt/kde4/include/stdcxx -I/opt/kde4/include -xtarget=pentium4 -m32 -xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8 -library=no%Cstd -library=Crun -features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplr efstatic -instances=global -template=geninlinefuncs -s -xdebugformat=dwarf -xlang=c99 -xalias_level=compatible -xustr=ascii_utf16_ushort -Qoption ccfe -features=gcc -Qoption ccfe -features=zla -Qoption ccfe ++boolflag:sunwcch=false -mt -L/opt/kde4/lib -R/opt/kde4/lib -library=no%Cstd -library=Crun -lstdcxx4 -I/usr/include/libpng14 -mt -I/usr/sfw/include -I/usr/sfw/include/freetype2 -KPIC -DPIC -DQT_SHARED -DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQT_NO_OPENTYPE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE -DQT_NO_STYLE_S60 -DQ_INTERNAL_QAPP_SRC -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -o .obj/release-shared/qpaintbuffer.o painting/qpaintbuffer.cpp
    "../3rdparty/harfbuzz/src/harfbuzz-impl.h", line 108: Warning (Anachronism): Attempt to redefine ERR without using #undef.
    "../../include/QtGui/private/../../../src/gui/text/qtextengine_p.h", line 423: Warning: Identifier expected instead of "}".
    "../../include/QtGui/private/../../../src/gui/text/qfontengine_p.h", line 363: Warning: QFontEngineBox::boundingBox hides the virtual function QFontEngine::boundingBox(unsigned, const QTransform&).
    "../../include/QtGui/private/../../../src/gui/text/qfontengine_p.h", line 363: Warning: QFontEngineBox::alphaMapForGlyph hides the virtual function QFontEngine::alphaMapForGlyph(unsigned, const QTransform&).
    "../../include/QtGui/private/../../../src/gui/text/qfontengine_p.h", line 411: Warning: QFontEngineMulti::boundingBox hides the virtual function QFontEngine::boundingBox(unsigned, const QTransform&).
    "../../include/QtGui/private/../../../src/gui/text/qfontengine_p.h", line 411: Warning: QFontEngineMulti::alphaMapForGlyph hides the virtual function QFontEngine::alphaMapForGlyph(unsigned, const QTransform&).
    "../../include/QtGui/private/../../../src/gui/painting/qemulationpaintengine_ p.h", line 104: Warning: QEmulationPaintEngine::clip hides the virtual function QPaintEngineEx::clip(const QPainterPath&, Qt::ClipOperation).
    "../../include/QtGui/private/../../../src/gui/painting/qemulationpaintengine_ p.h", line 104: Warning: QEmulationPaintEngine::clip hides the virtual function QPaintEngineEx::clip(const QRegion&, Qt::ClipOperation).
    "../../include/QtGui/private/../../../src/gui/painting/qemulationpaintengine_ p.h", line 104: Warning: QEmulationPaintEngine::clip hides the virtual function QPaintEngineEx::clip(const QRect&, Qt::ClipOperation).
    "../../include/QtGui/private/../../../src/gui/painting/qemulationpaintengine_ p.h", line 104: Warning: QEmulationPaintEngine::drawPixmap hides the virtual function QPaintEngineEx::drawPixmap(const QPointF&, const QPixmap&).
    "../../include/QtGui/private/../../../src/gui/painting/qemulationpaintengine_ p.h", line 104: Warning: QEmulationPaintEngine::drawImage hides the virtual function QPaintEngineEx::drawImage(const QPointF&, const QImage&).
    Wrong IR type: 27
    make[1]: *** [.obj/release-shared/qpaintbuffer.o] Error 2
    make[1]: Leaving directory `/opt/software/src/packages/BUILD/qt-4.7.1/i386/qt-everywhere-opensource-src-4. 7.1/src/gui'
    make: *** [sub-gui-make_default-ordered] Error 2

    The "wrong IR type" message is an internal compiler error. Try getting the all the current patches for the Studio compilers and see if that fixes the problem.
    Regarding your command line:
    Most of the options appear two or three times. You should look into cleaning up the option list.
    The -xchip and -xcache options are questionable. If you don't have a particular reason for needing them, remove these options. In the best case they might provide a small performance boost. In the worst case, they will reduce performance significantly.
    The -features option has a long list. Most of them are the default and cannot be disabled anyway.
    -features=except,rtti,export,tmplife fall into that category.
    -features=anachronisms is questionable. It allows code that was considered improper in 1991.
    -instances=global is the default
    -xalias_level=compatible makes strong claims about the program, allowing the optimizer to make simplifications that are not in general valid. (See the C++ Users Guide for details.) If any of those claims are not true, the program can fail in mysterious ways.

  • Migration from Sun solaris 8 to Solaris 10

    Hi,
    We are migrating from Solaris 8 to Solaris 10 with the compiler migration also earlier we are using Sun Studio 6 and now it is Sun Studio 11.
    When we are compiling the code on Solaris 10 which has been running on the Solaris 8, we are facing some error. So could you help me on this
    "ResourceManager.h", line 98: Warning (Anachronism): Type names qualified by template parameters require "typename".
    "ConnectionMgr.h", line 62: Where: While specializing "ResourceManager<T>".
    "ConnectionMgr.h", line 62: Where: Specialized in non-template code.
    "ResourceManager.h", line 100: Warning (Anachronism): Type names qualified by template parameters require "typename".
    "ConnectionMgr.h", line 62: Where: While specializing "ResourceManager<T>".
    "ConnectionMgr.h", line 62: Where: Specialized in non-template code.
    2 Warning(s) detected.
    make[1]: *** [obj/ConnectionMgr.o] Error 2
    Not sure of the warning , am not able to see these error on the compilation on Sun Studio 6.Below is the bit of the header file code, where the error is occurring.
    98 typedef map<ResourceID, ResElement *>::iterator ResMapIterator;
    100 typedef list<ResElement *>::iterator ResListIterator;
    We are using a /opt/SUNWspro/bin/CC compiler and the verison is CC: Sun C++ 5.8
    Please help me out about the issue

    Since you are jumping several compiler releases and two Solaris releases, you should migrate in two steps.
    1. Get your application working with Sun Studio 11 on Solaris 8.
    2. You can now run that application on Solaris 10, or you can rebuild it on Solaris 10 and then run it.
    An application built on Solaris 8 will run on Solaris 9 and 10.
    An application built on Solaris 10 cannot be run on Solaris 8 or 9.
    We promise upward binary compatibility, allowing an old binary to be used with a newer compiler or on a newer Solaris. But we can't promise source code compatibility because we don't want to have to duplicate old bugs in old compilers.
    C++ 5.8 in Sun Studio 11 detects errors that older compilers might have missed. The rules about where to use "typename" are one example.
    I would not expect the warning about typename to be generated by either of the source code lines that you show, but I can't really tell without seeing a compilable example.
    You need to use typename when you use a type that depends on a template parameter. Example:
    template <class T> class C1 {
    public:
        typedef T Type;
    template <class T> class C2 {
    public:
        typename T::Type a;
    C2< C1<int> > c2i;If in C2 you do not specify typename, the compiler does not know whether T::Type is intended to be the name of a type. If it is not a type, the code is always invalid. The C++ rule is that if an an identifier is not known to be a type, it is not a type. You use typename to tell the compiler that T::Type is supposed to be the name of a type.

  • SUN 4.2 and 5.3 compiler.

    We are in process of upgrading our system from SUN 4.2 compiler to 5.3 and facing some problem.
    Here is the very simple code for your reference.
    // File test.cpp (start)
    // ----------------part of code which I can not change (start) ------------------
    template <class T>
    class A
    public:
    typedef T* pointer;
    typedef T& reference;
    A(T& b) : a(b) {}
    private:
    reference a;
    typedef A<void>::reference B;
    //----------------part of code which I can not change (end) ------------------
    void main()
    int a = 10;
    A<void> b(void);
    // File test.cpp (end)
    The same code I am able to compile with 4.2 with out any problem.
    Here is the error message I am getting with 5.3 compiler.
    .../apurohit<183> /opt/SUNWspro/bin/CC -V -compat=4 test.cpp
    CC: Sun WorkShop 6 update 2 C++ 5.3 2001/05/15
    ccfe: Sun WorkShop 6 update 2 C++ 5.3 2001/05/15
    "trial.cpp", line 6: Error: Cannot declare a reference to void.
    "trial.cpp", line 12: Where: While specializing "A<void>".
    "trial.cpp", line 12: Where: Specialized in non-template code.
    "trial.cpp", line 7: Error: Cannot declare a reference to void.
    "trial.cpp", line 12: Where: While specializing "A<void>".
    "trial.cpp", line 12: Where: Specialized in non-template code.
    "trial.cpp", line 15: Warning (Anachronism): main() must have a return type of int.
    2 Error(s) and 1 Warning(s) detected.
    I know the reason for the error, but I want to know is there any solution for this problem?
    Thanks in advance.

    Template class A creates references to the type it is instantiated on. If you instantiate on type void, the code is invalid, because you cannot create a void&. (By definition, a reference must be initialized with an actual object, and there are no void objects.) C++ 4.2 was wrong to accept the invalid code.
    Clearly, you should not be trying to create type A<void>. If you need A<void> for some reason, you can create a specialization on void that does not generate any references to void. For example, add this code prior to any mention of A<void>:
    template<> class A<void> {
    public:
    typedef void* pointer;
    private:
    Ideally, this code should be added to the header that defines class template A, immediately after the primary template definition.
    Type A<void>::pointer will be valid, but not A<void>::reference. And you cannot create an A<void> object that has a reference member. You could have a pointer member, but usage of A<void> would then not be the same as the usage of A<T> for other types T.
    You say you cannot change the code. I'm afraid you will have to change the code, because I don't know of any compiler that will accept this invalid code.

  • Template problems with typename

    hi,
    I'm working using Sun Studio 11, here's a problem I just encountered.
    $ cat template.C
    template <class T>
    struct A {
    public:
    struct inside{
    typedef T value_type;
    template <class T>
    class B {
    public:
    #ifdef USE_TYPENAME
    void f(typename A<T>::inside::value_type v);
    #else
    void f(A<T>::value_type v);
    #endif
    #ifdef USE_TYPENAME
    template <class T>
    void B<T>::f(typename A<T>::inside::value_type v) { ; }
    #else
    template <class T>
    void B<T>::f(A<T>::value_type v) { ; }
    #endif
    int
    main()
    return 0;
    If I compiled it without the definition of USE_TYPENAME, there're only two warnings:
    "template.C", line 16: Warning (Anachronism): Type names qualified by template parameters require "typename".
    "template.C", line 28: Where: While specializing "B<T>".
    "template.C", line 28: Where: Specialized in non-template code.
    "template.C", line 28: Warning (Anachronism): Type names qualified by template parameters require "typename".
    But if I compiled it with -DUSE_TYPENAME, there's an weird error:
    $CC -DUSE_TYPENAME template.C
    "template.C", line 23: Error: "B<T>::f(value_type)" was previously declared "B<T>::f(value_type)".
    1 Error(s) detected.
    $
    Could anyone help me on this issue? Thanks!

    It must be a bug in Sun Studio 11 because Sun Studio 12 C++ compiler (version 5.9) compiles the code fine.
    In fact, applying latest patch to CC 5.8 will help. Patch IDs are 121018-11 for x86 and 121017-11 for sparc.

  • Suncc and PHP compatibility

    it seems that suncc have some trouble when working with PHP,hope you can imporve it:
    luoyi@4Email:~/src/lylib/trunk/topbuild$ cat do.sh
    #!/bin/sh
    echo "**************** first gcc *****************"
    make -B lib/xarray_php5.do
    echo "**************** then icc *****************"
    make -B lib/xarray_php5.do INTEL=1
    echo "**************** then pgroup *****************"
    make -B lib/xarray_php5.do PGROUP=1
    echo "**************** then pathscale *****************"
    make -B lib/xarray_php5.do PATHSCALE=1
    echo "**************** then suncc *****************"
    make -B lib/xarray_php5.do SUN=1
    luoyi@4Email:~/src/lylib/trunk/topbuild$ ./do.sh
    **************** first gcc *****************
    g++ -c -shared -fpic -fPIC -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -march=i686 -O2 -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    [DEP] ./build/dep/xarray.d
    **************** then icc *****************
    icpc -c -shared -fpic -fPIC -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -O3 -parallel -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    [DEP] ./build/dep/xarray.d
    **************** then pgroup *****************
    pgCC -c -shared -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -fastsse -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    [DEP] ./build/dep/xarray.d
    **************** then pathscale *****************
    pathCC -c -shared -fpic -fPIC -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -march=i686 -O2 -ipa -ffast-stdlib -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    [DEP] ./build/dep/xarray.d
    **************** then suncc *****************
    sunCC -library=stlport4 -c -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -fast -Bdynamic -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    "/usr/local/include/php/Zend/zend_alloc.h", line 34: Error: Type name expected instead of "uint".
    "/usr/local/include/php/Zend/zend_alloc.h", line 36: Error: Type name expected instead of "uint".
    "/usr/local/include/php/Zend/zend_hash.h", line 39: Error: "," expected instead of "(".
    "/usr/local/include/php/Zend/zend_hash.h", line 50: Error: Type name expected instead of "uint".
    "/usr/local/include/php/Zend/zend_hash.h", line 61: Error: Type name expected instead of "uint".
    "/usr/local/include/php/Zend/zend_hash.h", line 62: Error: Type name expected instead of "uint".
    "/usr/local/include/php/Zend/zend_hash.h", line 63: Error: Type name expected instead of "uint".
    "/usr/local/include/php/Zend/zend_hash.h", line 81: Error: Type name expected instead of "uint".
    "/usr/local/include/php/Zend/zend_hash.h", line 93: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 94: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 101: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 107: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 113: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 119: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 147: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 153: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 156: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 157: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 161: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 162: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 172: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 177: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 207: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 208: Error: uint is not defined.
    "/usr/local/include/php/Zend/zend_hash.h", line 209: Error: uint is not defined.
    Compilation aborted, too many Error messages.
    make: *** [lib/xarray_php5.do] Error 1
    luoyi@4Email:~/src/lylib/trunk/topbuild$ head ../cnqp/xarray/source/xarray.cpp
    // xarray = xml array
    // usage: php -r '$xml=file_get_contents("./data.xml");
    // $xml=iconv("GBK", "UTF-8", $xml);
    // $xml=str_replace("encoding=\"GBK\"", "encoding=\"UTF-8\"", $xml);
    // print_r(xmlarray($xml));'
    #include "php.h"
    #include "zend_API.h"
    #include "expat.h"
    #include "cnqp_log.h"
    Message was edited by:
    luoyi82

    oh, yes, thx for your reply. I can get it compile now:
    luoyi@4Email:~/src/lylib/trunk/topbuild$ ./do.sh
    **************** first gcc *****************
    g++ -c -shared -fpic -fPIC -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -march=i686 -O2 -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    [DEP] ./build/dep/xarray.d
    **************** then icc *****************
    icpc -c -shared -fpic -fPIC -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -O3 -parallel -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    [DEP] ./build/dep/xarray.d
    **************** then pgroup *****************
    pgCC -c -shared -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -fastsse -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    [DEP] ./build/dep/xarray.d
    **************** then pathscale *****************
    pathCC -c -shared -fpic -fPIC -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -march=i686 -O2 -ipa -ffast-stdlib -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    [DEP] ./build/dep/xarray.d
    **************** then suncc *****************
    sunCC -library=stlport4 -c -KPIC -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -fast -DLINUX -D_GNU_SOURCE -Bdynamic -o lib/xarray_php5.do ../cnqp/xarray/source/xarray.cpp
    "/usr/local/include/php/main/streams/php_stream_filter_api.h", line 66: Warning: Identifier expected instead of "}".
    "../cnqp/xarray/source/xarray.cpp", line 20: Warning: String literal converted to char* in initialization.
    "../cnqp/xarray/source/xarray.cpp", line 23: Warning: String literal converted to char* in initialization.
    "../cnqp/xarray/source/xarray.cpp", line 45: Warning: String literal converted to char* in initialization.
    "../cnqp/xarray/source/xarray.cpp", line 45: Warning (Anachronism): Using void(*)(int,_zval_struct*,_zval_struct**,_zval_struct*,int) to initialize extern "C" void(*)(int,_zval_struct*,_zval_struct**,_zval_struct*,int).
    "../cnqp/xarray/source/xarray.cpp", line 53: Warning: String literal converted to char* in initialization.
    "../cnqp/xarray/source/xarray.cpp", line 61: Warning: String literal converted to char* in initialization.
    "../cnqp/xarray/source/xarray.cpp", line 223: Warning: String literal converted to char* in formal argument type_spec in call to zend_parse_parameters(int, char*, ...).
    8 Warning(s) detected.
    [DEP] ./build/dep/xarray.d
    BTW: do you have any option that can make string literal not "const" ? so it'll not throw so many warnings.

  • Studio 8 compiler error using rogue wave header in std mode

    I get the following compiler error. I am using -library=rwtools7_std in the CC command.
    The error is:-
    "/opt/studio/SUNWspro/prod/include/CC/rw7/rw/rstream.h", line 46: Error: The name istream is ambiguous, istream and std::istream.
    "/opt/studio/SUNWspro/prod/include/CC/rw7/rw/rstream.h", line 46: Error: The name istream is ambiguous, istream and std::istream.
    "/opt/studio/SUNWspro/prod/include/CC/rw7/rw/rstream.h", line 46: Error: The type "istream" is incomplete.
    Please help
    Kandiah

    All,
    I'm getting the following error when I moved to Rogue Wave release 7.0 from 4.0. We're using Sun's FORTE C++ compiler version 7.0.
    Please advise
    *** Build for src 'all' target STARTED: Thu Jan 18 16:37:04 EST 2007
    /xenv/Forte/sun4/7.0/5.8p4/prod/bin/CC -g -features=no%conststrings -DCPLUSREL=7 -D_RWCONFIG=12d -DRW_MULTI_THREAD -O -mt -D_REENTRANT -c -I. -I/xenv/rwsp_tools/sun4/5.8p4/7.0/32/core900_12d -I/xenv/mqi/sun4/5.x/5.3.0.5/inc -I/xenv/ccs_standard_s8/sun4/5.8p4/4.1_B1/include MQInfo.cc MQBase.cc ZeusAccountBridge.cc
    MQInfo.cc:
    MQBase.cc:
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/defs.h", line 316: Error: A typedef name cannot be used in an elaborated type specifier..
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/defs.h", line 317: Error: A typedef name cannot be used in an elaborated type specifier..
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/defs.h", line 318: Error: A typedef name cannot be used in an elaborated type specifier..
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/stringid.h", line 50: Error: A typedef name cannot be used in an elaborated type specifier..
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/stringid.h", line 51: Error: A typedef name cannot be used in an elaborated type specifier..
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/collint.h", line 75: Error: A typedef name cannot be used in an elaborated type specifier..
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/collint.h", line 76: Error: A typedef name cannot be used in an elaborated type specifier..
    7 Error(s) detected.
    ZeusAccountBridge.cc:
    "/xenv/ccs_standard_s8/sun4/5.8p4/4.1_B1/include/ccs_data.h", line 126: Warning (Anachronism): Using int(*)(void*,ccs_Data*) to initialize void*.
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/defs.h", line 316: Error: A typedef name cannot be used in an elaborated type specifier..
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/defs.h", line 317: Error: A typedef name cannot be used in an elaborated type specifier..
    "/xenv/Forte/sun4/7.0/5.8p4/prod/include/CC/rw7/rw/defs.h", line 318: Error: A typedef name cannot be used in an elaborated type specifier..
    3 Error(s) and 1 Warning(s) detected.

  • Reporting a bug for the C++ compiler

    How do I report a bug to Oracle regarding the C++ compiler ? I am using Solaris Studio 12.3.

    Here is an alternative implementation, as a file called has_xxx_test_ex.cpp, also supported by the mpl and tti code for introspecting a class/struct for a class template of a given name taking typename ( or class ) type parameters:
    struct stype { template< typename T > struct xxx {}; };
    typedef void boost_mpl_has_xxx_has_xxx_template_substitute0_tag ;
    template < template < typename U0 > class U >
    struct boost_mpl_has_xxx_has_xxx_template_substitute0
        typedef boost_mpl_has_xxx_has_xxx_template_substitute0_tag type ;
    template < template < typename U0 , typename U1 > class U >
    struct boost_mpl_has_xxx_has_xxx_template_substitute1
        typedef boost_mpl_has_xxx_has_xxx_template_substitute0_tag type ;
    template < typename T >
    class has_xxx_template
        template < typename U , typename V = boost_mpl_has_xxx_has_xxx_template_substitute0_tag >
        struct has_xxx_template_test
            static const bool value = false ;
        template < typename U >
        struct has_xxx_template_test <     U ,
                                        typename boost_mpl_has_xxx_has_xxx_template_substitute0
                                            < typename U :: xxx < > > :: type
                                     >
            static const bool value = true ;
        template < typename U >
        struct has_xxx_template_test <    U ,
                                        typename boost_mpl_has_xxx_has_xxx_template_substitute1
                                            < typename U :: xxx < > > :: type
                                     >
            static const bool value = true ;
        template < typename U >
        struct has_xxx_template_introspect : has_xxx_template_test < U > { } ;
        public :
            static const bool value = has_xxx_template_introspect < T > :: value ;
    int main()
        has_xxx_template<stype> aclass;
        return 0;
    When this is compiled with the C++ compiler of 12.3 with this command line:
    CC +d -library=stlport4 -features=tmplife -features=tmplrefstatic -g -erroff=%none -KPIC -c -o "has_xxx_test_ex2.o" "has_xxx_test_ex2.cpp"
    the result is:
    "has_xxx_test_ex2.cpp", line 30: Warning (Anachronism): Using xxx as a template without a declaration.
    "has_xxx_test_ex2.cpp", line 54:     Where: While specializing "has_xxx_template<stype>".
    "has_xxx_test_ex2.cpp", line 54:     Where: Specialized in non-template code.
    "has_xxx_test_ex2.cpp", line 30: Error: Template template-parameter U<U0> requires a class template argument.
    "has_xxx_test_ex2.cpp", line 54:     Where: While specializing "has_xxx_template<stype>".
    "has_xxx_test_ex2.cpp", line 54:     Where: Specialized in non-template code.
    "has_xxx_test_ex2.cpp", line 39: Warning (Anachronism): Using xxx as a template without a declaration.
    "has_xxx_test_ex2.cpp", line 54:     Where: While specializing "has_xxx_template<stype>".
    "has_xxx_test_ex2.cpp", line 54:     Where: Specialized in non-template code.
    "has_xxx_test_ex2.cpp", line 39: Error: Template template-parameter U<U0, U1> requires a class template argument.
    "has_xxx_test_ex2.cpp", line 54:     Where: While specializing "has_xxx_template<stype>".
    "has_xxx_test_ex2.cpp", line 54:     Where: Specialized in non-template code.
    "has_xxx_test_ex2.cpp", line 36: Error: Multiple declaration for has_xxx_template<stype>::has_xxx_template_test.
    "has_xxx_test_ex2.cpp", line 54:     Where: While specializing "has_xxx_template<stype>".
    "has_xxx_test_ex2.cpp", line 54:     Where: Specialized in non-template code.
    3 Error(s) and 2 Warning(s) detected.

  • C++ 5.3 missing include files

    I have Forte 6 update 2 C++ compiler , patch 108434-05 on Solaris sparc 5.8. When I try to compile code written for 4.1 compiler, with option -compat=4, I get errs saying that stddef.h and string.h is not found. Can anyone suggest a remedy.
    The same code, when compiled in standard mode (-compat = 5) produced similar errs. sys/feature_tests.h and sys/isa_defs.h not found.
    This is the compile script with - v option and the errors.
    (for -compat=4)
    ### command line files and options (expanded):
    ### -v -o dbtitle.o -g -compat=4 -c -mt -DSOLSPARC -I/opt/lotus/notescpp/include dbtitle.cpp -library=rwtools7
    ### CC: Note: LM_LICENSE_FILE = /homes/sjoseph/key.txt
    ### CC: Note: NLSPATH = /BA/opt/SUNWspro/bin/../WS6U2/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/BA/opt/SUNWspro/bin/../WS6U2/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
    /BA/opt/SUNWspro/bin/../WS6U2/bin/ccfe -y-o -ydbtitle.o -I/opt/lotus/notescpp/include -y-fbe -y/BA/opt/SUNWspro/bin/../WS6U2/bin/fbe -ptb dbtitle.o -y-xarch=generic -y-verbose -O0 -ptf /tmp/05721%1.%2 -ptx /BA/opt/SUNWspro/bin/../WS6U2/bin/CC -ptk "-v -g -compat=4 -c -mt -DSOLSPARC -library=rwtools7,iostream -I/opt/lotus/notescpp/include " -D_REENTRANT -D__SunOS_5_8 -D__SUNPRO_CC=0x530 -Dunix -Dsun -Dsparc -D__sparc -D__unix -D__sun -D__BUILTIN_VA_ARG_INCR -D__SVR4 -D__SUNPRO_CC_COMPAT=4 -compat=4 -g +d -y-g -I-xbuiltin -I/BA/opt/SUNWspro/WS6U2/include/CC4 -I/BA/opt/SUNWspro/WS6U2/include/CC/rw7 -I/BA/opt/SUNWspro/WS6U2/include/cc -D__SUN_PREFETCH -DSOLSPARC dbtitle.cpp -s /tmp/ccfe.05721.0.s
    "/opt/lotus/notescpp/include/lnglosym.h", line 102: Error: Could not open include file <stddef.h>.
    "/opt/lotus/notescpp/include/lnglosym.h", line 103: Error: Could not open include file <string.h>.
    "/opt/lotus/notescpp/include/lnglofun.h", line 38: Error: size_t is not defined.
    "/opt/lotus/notescpp/include/lncommon.hpp", line 42: Error: size_t is not defined.
    "/opt/lotus/notescpp/include/lncommon.hpp", line 144: Error: The function "memcpy" must have a prototype.
    "/opt/lotus/notescpp/include/lncommon.hpp", line 151: Error: The function "memcpy" must have a prototype.
    "/opt/lotus/notescpp/include/lndate.hpp", line 337: Error: The function "memcpy" must have a prototype.
    "/opt/lotus/notescpp/include/lndate.hpp", line 344: Error: The function "memcpy" must have a prototype.
    "/opt/lotus/notescpp/include/lnsessio.hpp", line 240: Error: size_t is not defined.
    9 Error(s) detected.
    rm /tmp/ccfe.05721.0.s
    This is the compile script with - v option and the errors.
    (for std mode)
    ### command line files and options (expanded):
    ### -v -o dbtitle.o -g -c -mt -DSOLSPARC -I/opt/lotus/notescpp/include dbtitle.cpp -library=rwtools7,iostream
    ### CC: Note: LM_LICENSE_FILE = /homes/sjoseph/key.txt
    ### CC: Note: NLSPATH = /BA/opt/SUNWspro/bin/../WS6U2/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/BA/opt/SUNWspro/bin/../WS6U2/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
    /BA/opt/SUNWspro/bin/../WS6U2/bin/ccfe -y-o -ydbtitle.o -I/opt/lotus/notescpp/include -y-fbe -y/BA/opt/SUNWspro/bin/../WS6U2/bin/fbe -ptb dbtitle.o -y-xarch=generic -y-verbose -O0 -ptf /tmp/05704%1.%2 -ptx /BA/opt/SUNWspro/bin/../WS6U2/bin/CC -ptk "-v -g -c -mt -DSOLSPARC -library=rwtools7,iostream -I/opt/lotus/notescpp/include " -D_REENTRANT -D__SunOS_5_8 -D__SUNPRO_CC=0x530 -Dunix -Dsun -Dsparc -D__sparc -D__unix -D__sun -D__BUILTIN_VA_ARG_INCR -D__SVR4 -D__SUNPRO_CC_COMPAT=5 -g +d -y-g -I-xbuiltin -I/BA/opt/SUNWspro/WS6U2/include/CCios -instlib=/BA/opt/SUNWspro/WS6U2/lib/libCstd.a -I/BA/opt/SUNWspro/WS6U2/include/CC/Cstd -I/BA/opt/SUNWspro/WS6U2/include/CC -I/BA/opt/SUNWspro/WS6U2/include/CC/rw7 -I/BA/opt/SUNWspro/WS6U2/include/cc -D__SUN_PREFETCH -DSOLSPARC dbtitle.cpp -s /tmp/ccfe.05704.0.s
    "/BA/opt/SUNWspro/WS6U2/include/CC/std/stddef.h", line 7: Error: Could not open include file <sys/feature_tests.h>.
    "/BA/opt/SUNWspro/WS6U2/include/CC/std/stddef.h", line 15: Error: Could not open include file <sys/isa_defs.h>.
    "/BA/opt/SUNWspro/WS6U2/include/CC/std/string.h", line 7: Error: Could not open include file <sys/feature_tests.h>.
    "/opt/lotus/notescpp/include/ods.h", line 61: Error: #define and #undef are not legal for predefined macros.
    "/opt/lotus/notescpp/include/ods.h", line 61: Warning (Anachronism): Attempt to redefine _BOOL without using #undef.
    4 Error(s) and 1 Warning(s) detected.
    rm /tmp/ccfe.05704.0.s

    Do you have the SUNWhea package on your system? This package contains the headers you seem to be missing. It's on the Solaris 8 CDROM 2 of 2. If you don't know how to add packages from the CDROM, look up "Adding and Removing Software After Installing Solaris 8" in the "Solaris 8 Advanced Installation Guide" on docs.sun.com.

  • SS12.2 unable to compile a scientific lib (works with g++)

    Hi,
    I would like to compile the palabos library (Parallel Lattice Boltzmann Solver). I've got thos erreurs with solstudio 12.2 (Sun X4600 with linux CentOS 5.5) :
    CC -o cylinder2d.o -c -library=stlport4 -features=tmplife -features=tmplrefstatic -O3 -DPLB_USE_POSIX -I/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src -I/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/externalLibraries cylinder2d.cpp
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/core/blockIdentifiers.h", line 119: Warning: Identifier expected instead of "}".
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/core/dynamicsIdentifiers.hh", line 123: Error: A previously specified default argument value cannot be changed.
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/externalLibraries/Eigen/src/Core/CacheFriendlyProduct.h", line 41: Error: Eigen::ei_cache_friendly_product<Eigen::Scalar>(int, int, int, bool, const Eigen::Scalar*, int, bool, const Eigen::Scalar*, int, bool, Eigen::Scalar*, int) was previously declared "extern", not "static".
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/multiBlock/multiBlockGenerator2D.hh", line 79: Error: A previously specified default argument value cannot be changed.
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/multiBlock/multiBlockGenerator2D.hh", line 309: Error: A previously specified default argument value cannot be changed.
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/multiBlock/multiBlockGenerator2D.hh", line 543: Error: A previously specified default argument value cannot be changed.
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/dataProcessors/metaStuffFunctional2D.hh", line 156: Warning (Anachronism): Type names qualified by template parameters require "typename".
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/core/dynamics.h", line 588: Warning: plb::BounceBack<double, plb::descriptors::D2Q9Descriptor<plb::descriptors::T>>::rescale hides the virtual function plb::Dynamics<double, plb::descriptors::D2Q9Descriptor<plb::descriptors::T>>::rescale(int, int).
    "cylinder2d.cpp", line 164:     Where: While specializing "plb::BounceBack<double, plb::descriptors::D2Q9Descriptor<plb::descriptors::T>>".
    "cylinder2d.cpp", line 164:     Where: Specialized in non-template code.
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/basicDynamics/isoThermalDynamics.h", line 102: Warning: plb::IsoThermalBulkDynamics<double, plb::descriptors::D2Q9Descriptor<plb::descriptors::T>>::rescale hides the virtual function plb::Dynamics<double, plb::descriptors::D2Q9Descriptor<plb::descriptors::T>>::rescale(int, int).
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/basicDynamics/isoThermalDynamics.h", line 106:     Where: While specializing "plb::IsoThermalBulkDynamics<double, plb::descriptors::D2Q9Descriptor<plb::descriptors::T>>".
    "/home/jobic/projet/Portflo/palablos/palabos-v0.7r2/src/basicDynamics/isoThermalDynamics.h", line 106:     Where: Specialized in plb::BGKdynamics<double, plb::descriptors::D2Q9Descriptor<plb::descriptors::T>>.
    "cylinder2d.cpp", line 207:     Where: Specialized in non-template code.
    5 Error(s) and 4 Warning(s) detected.As you can see, i used thoses options :
    -library=stlport4 -features=tmplife -features=tmplrefstatic
    Anybody has ever seen this kind of problm ?
    It's working fine with g++, but i would like to use solstudio.
    Is there a workaround ?
    Thanks in advance for help,

    Here is the prototype :
    template<typename T, template<typename U> class Descriptor>
    std::string constructIdNameChain(std::vector<int> const& ids, std::string separator=".");And the function itself :
    template<typename T, template<typename U> class Descriptor>
    std::string constructIdNameChain(std::vector<int> const& ids, std::string separator=".")
       std::string nameChain;
       if (ids.size()>0 && ids[0]>=0) {
           nameChain += dynamicsRegistration<T,Descriptor>().
                            getName(ids[0]);
       for (pluint i=1; i<ids.size(); ++i) {
           if (ids>=0) {
    nameChain += separator;
    nameChain += dynamicsRegistration<T,Descriptor>().
    getName(ids[i]);
    return nameChain;
    it seems a different case.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • How can I organize groups in Address Book while running iCloud under Lion?

    I am frustrated with the new Address Book for many reasons: It is no longer possible to view groups, list, and cards at the same time, just groups and list or list and cards.  This means it is very cumbersome to organize cards to multiple groups, som

  • How to use connec with java 6.0 ?

    I often use the function below to connect Database:      public Connection getConnection(){ try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); conn=DriverManager.getConnection("jdbc:odbc:EmployeeManagerDB","sa","sa"); System.out.println("Get connect

  • Image preview thumbnails suddenly not displaying: just generic .jpg

    I have a series of folders containign images. I surf through them all the time using the Finder in Icon mode, where I can see the image itself as the thumbnail. For some reason now all I'm getting is the generic file format image (in this case, .jpg)

  • How do i use my notes?

    i dont understand how to use it.

  • Querry regarding Evaluation path in org management

    Hi Experts, I need to configure an evaluation path as follows. 1.  A manager  M1 belongs to org unit O1. He manages Org unit O2. 2.  Org unit O2 reports to O1. similarly O3 also reports to O1. 3.  Now I need to develop a evaluation path in which, M1