in reply to Inline C solaris vs linux

Hello All,

Oh. That.

From what I've been told, the groan that came out of my office was heard in the next building. Then, because of the alternating chuckles and muttered curses, it took 30 minutes to convince the paramedics that I was ok. I had to sign a waiver.

"that doesn't hold on a big-endian machine" pointed me in the right direction. Using %llu instead of %lu in printf shows the code actually working. Thank you.

For the record, perl Config datatypes from linux:

intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, prototype=define

The compiler on solaris is Solaris Studio CC. The compiling host is running solaris 5.10, and is the same host used to compile perl. The cc commandline below was taken from the output of Inline C with BUILD_NOISY enabled.

cc -V says: cc: Sun C 5.12 SunOS_sparc Spica 2011/08/03 /import/tools/vendor/sun/solaris-sparc/studio13b26/solstudiodev/bin/cc + -c -I"/import/coverage5/ccg/qot/vx/inline-dev/test" -D_REENTRANT -K +PIC -DUSE_HASH_SEED_EXPLICIT -DPERL_USE_SAFE_PUTENV -D_LARGEFILE_SOUR +CE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -O -DVERSION=\"0.0 +0\" -DXS_VERSION=\"0.00\" -KPIC "-I/import/tools/local/perl/perl-5.18 +.4/lib/5.18.4/sun4-solaris-thread-multi-64int/CORE" Short_00d0.c

Snip of output from working code:

obj size : 4 obj val : 2bf2d8 thing size : 4 thing val : 7895864 thing simtime p : 40 thing simtime A : 20 thing index A : 1 thing simtime B : 40 << this is what I was looking for thing index B : 2 << this is what I was looking for

Thanks to everyone. If not for you, I'd probably still be crawling all over perlapi.