Hello there, in order to build 1.0.3 with active "--enable-gcc-warnings", with Debian Squeeze, I find myself forced to apply the patching reproduced below.
On one hand, "-Wenum-compare" produces a large number of comments, since it is ignored while encountered by CC, and whil being applicable only to C++ and allies. More severe is the fact that upstream Gnulib is by policy not acting against compiler warnings inherent in their code basis. This hits Shishi in two files: gl/timespec.h gl/xalloc.h where four inline functions are missing their prototypes, warnings which are upgraded to errors when building with "--enable-gcc-warnings". Is there a method to relax the use of "-W*" in "gl/"? The problem is that both the files named above are referenced in "lib/*", so preprocessor options are seemingly interdependent. It is unfortunate to mend files imported from Gnulib, but that was the only action I could think of. Regards, Mats Erik Andersson
>From 02b4b377748e5740df8ecf63214505459b618f7f Mon Sep 17 00:00:00 2001 From: Mats Erik Andersson <g...@gisladisker.se> Date: Fri, 5 Apr 2013 14:42:05 +0200 Subject: [PATCH] Warnings caused by gnulib. --- gl/m4/manywarnings.m4 | 1 - gl/timespec.h | 9 +++++++++ gl/xalloc.h | 3 +++ 3 files changed, 12 insertions(+), 1 deletions(-) diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4 index 45a30af..f71ddb9 100644 --- a/gl/m4/manywarnings.m4 +++ b/gl/m4/manywarnings.m4 @@ -117,7 +117,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wdouble-promotion \ -Wempty-body \ -Wendif-labels \ - -Wenum-compare \ -Wextra \ -Wformat-contains-nul \ -Wformat-extra-args \ diff --git a/gl/timespec.h b/gl/timespec.h index d665e6c..34c370a 100644 --- a/gl/timespec.h +++ b/gl/timespec.h @@ -55,6 +55,9 @@ _GL_INLINE_HEADER_BEGIN The (int) cast avoids a gcc -Wconversion warning. */ _GL_TIMESPEC_INLINE int +timespec_cmp (struct timespec a, struct timespec b); + +_GL_TIMESPEC_INLINE int timespec_cmp (struct timespec a, struct timespec b) { return (a.tv_sec < b.tv_sec ? -1 @@ -65,6 +68,9 @@ timespec_cmp (struct timespec a, struct timespec b) /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be nonnegative. */ _GL_TIMESPEC_INLINE int +timespec_sign (struct timespec a); + +_GL_TIMESPEC_INLINE int timespec_sign (struct timespec a) { return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; @@ -79,6 +85,9 @@ struct timespec dtotimespec (double) /* Return an approximation to A, of type 'double'. */ _GL_TIMESPEC_INLINE double +timespectod (struct timespec a); + +_GL_TIMESPEC_INLINE double timespectod (struct timespec a) { return a.tv_sec + a.tv_nsec / 1e9; diff --git a/gl/xalloc.h b/gl/xalloc.h index da7c4b6..7c7029b 100644 --- a/gl/xalloc.h +++ b/gl/xalloc.h @@ -173,6 +173,9 @@ xnrealloc (void *p, size_t n, size_t s) */ XALLOC_INLINE void * +x2nrealloc (void *p, size_t *pn, size_t s); + +XALLOC_INLINE void * x2nrealloc (void *p, size_t *pn, size_t s) { size_t n = *pn; -- 1.7.2.5
_______________________________________________ Help-shishi mailing list Help-shishi@gnu.org https://lists.gnu.org/mailman/listinfo/help-shishi