Bug 99680

Summary: Compile error on solaris 2.6 - kdepim-3.3.92/libkholidays/lunarphase.cpp uses sys/cdefs.h which is not available
Product: [Applications] korganizer Reporter: Steve Evans <stevee>
Component: generalAssignee: Reinhold Kainhofer <reinhold>
Status: RESOLVED FIXED    
Severity: normal CC: bernd.kuhls
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Solaris   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Steve Evans 2005-02-18 10:56:26 UTC
Version:            (using KDE KDE 3.3.92)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Solaris

I get this compile error:

if /bin/ksh ../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../libkdepim -I/opt/kde/include -I/opt/qt/include   -I/gorbag/exta/cad/externals/SOLARIS/include  -DQT_THREAD_SUPPORT -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4 -D_FILE_OFFSET_BITS=64  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2-I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include -O2 -fomit-frame-pointer -DNeedVarargsPrototypes=1 -DNeedFunctionPrototypes=1 -pipe -fno-exceptions -mcpu=ultrasparc -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL-DQT_NO_COMPAT -DQT_NO_TRANSLATION  -MT lunarphase.lo -MD -MP -MF ".deps/lunarphase.Tpo" -c -o lunarphase.lo lunarphase.cpp; \
then mv -f ".deps/lunarphase.Tpo" ".deps/lunarphase.Plo"; else rm -f ".deps/lunarphase.Tpo"; exit1; fi
lunarphase.cpp:184:23: sys/cdefs.h: No such file or directory
lunarphase.cpp:200:17: err.h: No such file or directory
Comment 1 Steve Evans 2005-02-18 11:00:15 UTC
Commenting out the includes of sys/cdefs.h and err.h allows it to compile
Comment 2 groot 2005-02-18 12:33:25 UTC
CVS commit by adridg: 

Check for headers before using them (compiles fine on Solaris without cdefs
and err).

BUG: 99680


  M +1 -1      configure.in.in   1.43
  M +6 -0      libkholidays/lunarphase.cpp   1.3


--- kdepim/configure.in.in  #1.42:1.43
@@ -2,5 +2,5 @@
 AC_HEADER_DIRENT
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h sys/sysctl.h sys/param.h sys/time.h sys/types.h unistd.h values.h sys/limits.h)
+AC_CHECK_HEADERS(fcntl.h sys/sysctl.h sys/param.h sys/time.h sys/types.h unistd.h values.h sys/limits.h err.h sys/cdefs.h)
 
 AC_CHECK_SETENV

--- kdepim/libkholidays/lunarphase.cpp  #1.2:1.3
@@ -32,4 +32,6 @@
 */
 
+#include "config.h"
+
 #include <kglobal.h>
 #include <klocale.h>
@@ -182,5 +184,7 @@ LunarPhase::Phase LunarPhase::phase( con
  */
 
+#if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif
 
 /*
@@ -198,5 +202,7 @@ LunarPhase::Phase LunarPhase::phase( con
 
 #include <ctype.h>
+#if HAVE_ERR_H
 #include <err.h>
+#endif
 #include <math.h>
 #include <string.h>


Comment 3 Brad Hards 2005-02-18 12:50:08 UTC
Commenting them out on my (Fedora Core 2 based Linux) system, it still compiles fine. Is it needed on a BSD system? Looks like old BSD code, so probably worth a check...
Comment 4 Thiago Macieira 2005-02-19 02:01:51 UTC
*** Bug 99620 has been marked as a duplicate of this bug. ***
Comment 5 Thiago Macieira 2005-02-19 02:03:13 UTC
Thanks for the reports, both of you. But could you please check that the other one hasn't posted the same bug already?

You're going to find the same bugs.