MantisBT - CMake
View Issue Details
0013277CMakeCMakepublic2012-06-07 12:572012-11-05 14:33
Daniel Richard G. 
 
normalminoralways
closedfixed 
SPARCSolaris8
CMake 2.8.8 
CMake 2.8.9CMake 2.8.9 
0013277: archive_endian.h needs "inline" fix for Sun WorkShop (SunPro) compiler
Building CMake's git nightly on a Solaris 8 system with the SunPro compiler yields

[ 38%] Building C object Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_read_support_filter_rpm.c.o
".../CMake/Utilities/cmlibarchive/libarchive/archive_endian.h.", line 59: undefined or not a type: inline
".../CMake/Utilities/cmlibarchive/libarchive/archive_endian.h", line 61: parameter not in identifier list: archive_be16dec
".../CMake/Utilities/cmlibarchive/libarchive/archive_endian.h", line 61: syntax error before or at: {
[...]

(See http://open.cdash.org/viewBuildError.php?buildid=2340544 [^] for more)

This compiler doesn't grok "inline"---at least not version 5.1.

A proposed patch (against git nightly) that addresses this is attached. The macro magic is gleaned from http://lists.x.org/archives/xorg-devel/2009-April/000580.html [^] .
No tags attached.
patch cmake-sunpro-inline-fix.patch (857) 2012-06-07 12:57
https://public.kitware.com/Bug/file/4346/cmake-sunpro-inline-fix.patch
Issue History
2012-06-07 12:57Daniel Richard G.New Issue
2012-06-07 12:57Daniel Richard G.File Added: cmake-sunpro-inline-fix.patch
2012-06-07 13:03Brad KingNote Added: 0029626
2012-06-07 13:40Daniel Richard G.Note Added: 0029627
2012-06-07 13:47Brad KingNote Added: 0029628
2012-06-07 15:00Daniel Richard G.Note Added: 0029634
2012-06-07 15:25Brad KingNote Added: 0029639
2012-06-07 15:25Brad KingStatusnew => resolved
2012-06-07 15:25Brad KingResolutionopen => fixed
2012-06-07 15:25Brad KingFixed in Version => CMake 2.8.9
2012-06-07 15:25Brad KingTarget Version => CMake 2.8.9
2012-11-05 14:33David ColeNote Added: 0031446
2012-11-05 14:33David ColeStatusresolved => closed

Notes
(0029626)
Brad King   
2012-06-07 13:03   
For SunPro >= 5.9 why "define inline __inline__" instead of just leaving it undefined?
(0029627)
Daniel Richard G.   
2012-06-07 13:40   
Hmm. I thought that was so things would continue to work in strict-ANSI mode (as with g++), but I just tried the 5.10 compiler using -Xc, and it accepts plain old "inline" just as well.

I guess leaving it undefined should be fine, then :-]
(0029628)
Brad King   
2012-06-07 13:47   
How about this?

diff --git a/Utilities/cmlibarchive/libarchive/archive_endian.h b/Utilities/cmlibarchive/libarchive/archive_endian.h

index c3c78b3..bbf58fd 100644
--- a/Utilities/cmlibarchive/libarchive/archive_endian.h
+++ b/Utilities/cmlibarchive/libarchive/archive_endian.h
@@ -45,11 +45,14 @@
  * - SGI MIPSpro
  * - Microsoft Visual C++ 6.0 (supposedly newer versions too)
  * - IBM VisualAge 6 (XL v6)
+ * - Sun WorkShop C (SunPro) before 5.9
  */
 #if defined(__WATCOMC__) || defined(__sgi) || defined(__hpux) || defined(__BORLANDC__)
 #define        inline
 #elif defined(__IBMC__) && __IBMC__ < 700
 #define        inline
+#elif defined(__SUNPRO_C) && __SUNPRO_C < 0x590
+#define inline
 #elif defined(_MSC_VER) || defined(__osf__)
 #define inline __inline
 #endif
(0029634)
Daniel Richard G.   
2012-06-07 15:00   
Yep, that gets cmlibarchive built.
(0029639)
Brad King   
2012-06-07 15:25   
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54ffb5b4 [^]
(0031446)
David Cole   
2012-11-05 14:33   
Closing resolved issues that have not been updated in more than 4 months.