sunstudio

Warning (Anachronism): Assigning void(*)(int) to extern “C” void(*)(int)

时光毁灭记忆、已成空白 提交于 2019-12-12 18:08:32
问题 I'm having trouble with Sun's C++ compiler. I've read Oracle's Working with Pointers to Functions [from C++]. Its a good read, and I get the impression SunCC is most compliant among all the compilers in this area (though its causing me trouble). The test code is below, and line 24 is new_handler.sa_handler = (pfn ? pfn : &SignalHandler::NullHandler); . Unrolling the ternary operator shows this is the issue: new_handler.sa_handler = pfn; . SunCC 5.11 $ /opt/solstudio12.2/bin/CC test.cxx "test

What causes SunCC crash in g3mangler.cc when using `-std=XXX`?

妖精的绣舞 提交于 2019-12-11 05:53:42
问题 I'm trying to determine what is causing SunCC 5.11 - 5.13 to die with ../lnk/g3mangler.cc, line 825 (message from SunCC 5.13). Here's what it looks like during a compile. The machine is a 4th gen Core i5, so its got the features which correspond to the macros. /opt/solarisstudio12.4/bin/CC -DDEBUG -g3 -O0 -std=c++03 -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__AVX__ -xarch=avx -m64 -native -KPIC -template=no%extdef -w -erroff=wvarhidemem

How to print preprocessor macros under Sun Studio?

孤街浪徒 提交于 2019-12-11 02:25:46
问题 I'm working under Sun Studio 12.3 on SunOS 5.11 (Solaris 11.3). I need to see the macros that Sun Studio defines to fix a bug report taken under the suite. This is similar to Solaris and Preprocessor Macros, but the cited question uses GCC and its preprocessor; and not Sun Studio's preprocessor. I've run CC -flags but I don't see an option similar to GCC's cpp -dM or g++ -dM -E - </dev/null . CC does have a -E , but its fairly anemic and does not print any preprocessor definitions: $ echo

Building Boost on Solaris

落爺英雄遲暮 提交于 2019-12-05 13:06:58
Will Boost build in entirety on Solaris? I'd like to know if anyone has success with this (specifically Proto/Spirit) before I go and pay for a support contract to patch Sun Studio 12.2 to the latest. I get a few errors and some look to have been resolved in patches, but it's not cheap to pay Oracle for support so I'd rather some hope that it will work before I do. Right now, I'm just trying to use cpp-netlib on Solaris and decode some JSON fetched over HTTP using Boost Property Tree. It works fine on Mac OS X - so I'm hoping I can use the same code on Solaris. If you look at http://www.boost

Mixing PIC and non-PIC objects in a shared library

喜你入骨 提交于 2019-12-03 14:25:21
This question is related to this one as well as its answer. I just discovered some ugliness in a build I'm working on. The situation looks somewhat like the following (written in gmake format); note, this specifically applies to a 32-bit memory model on sparc and x86 hardware: OBJ_SET1 := some objects OBJ_SET2 := some objects # note: OBJ_SET2 doesn't get this flag ${OBJ_SET1} : CCFLAGS += -PIC ${OBJ_SET1} ${OBJ_SET2} : %.o : %.cc ${CCC} ${CCFLAGS} -m32 -o ${@} -c ${<} obj1.o : ${OBJ_SET1} obj2.o : ${OBJ_SET2} sharedlib.so : obj1.o obj2.o obj1.o obj2.o sharedlib.so : ${LINK} ${LDFLAGS} -m32

SunStudio C++ compiler pragma to disable warnings?

梦想的初衷 提交于 2019-12-01 20:56:05
The STLport bundled with the SunStudio11 generates alot of warnings. I beleive most compilers have a way to disable warnings from certain source files, like this: Sun C #pragma error_messages off #include <header.h> // ... #pragma error_messages on gcc #pragma warning(push, 0) #include <header.h> // ... #pragma warning(pop) How do you do this in the SunStudio C++ compiler? (btw, the sunstudio C pragmas don't work in sunstudio C++) In SunStudio 12, the #pragma error_messages work as documented in the C users manual. You can see the tags with the -errtags=yes option, and use it like this: //

How to swap two __m128i variables in C++03 given its an opaque type and an array?

99封情书 提交于 2019-12-01 08:35:34
What is the best practice for swapping __m128i variables? The background is a compile error under Sun Studio 12.2 , which is a C++03 compiler. __m128i is an opaque type used with MMX and SSE instructions, and its usually and unsigned long long[2] . C++03 does not provide the support for swapping arrays, and std:swap(__m128i a, __m128i b) fails under the compiler. Here are some related questions that don't quite hit the mark. They don't apply because std::vector is not available. How can we swap 2 arrays in constant complexity or O(1)? Is it possible to swap arrays of structs C++03 moving a

Sun Studio linking gcc libs: exceptions do not work

…衆ロ難τιáo~ 提交于 2019-11-29 10:52:36
I need to build an application with Sun Studio. This application uses a shared library which can only be build with Gnu C++. The shared lib has a C Interface, so that the code is callable by the Sun Compiler (this is to avoid name mangling issues, see also this question ). Everything besides exception handling works fine. When an exception is thrown in the shared library, the program segfaults. This happens only when the main program is compiled using the Sun Studio Compiler. Compiling the minimal example below with the Gnu C++ compiler, the program works fine and the shared lib detects the