always define G_GNUC_EXTENSION, even when not needed by GLib. That's
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Tue, 21 Mar 2000 15:21:41 +0000 (15:21 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Tue, 21 Mar 2000 15:21:41 +0000 (15:21 +0000)
2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

* glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
even when not needed by GLib. That's actually also the way, the
GLib reference manual describes that macro. Therefore I had to
remove the lonesome #include <glibconfig.h> in gutils.c, which
doesn't seem to be needed there however. This change should make
Ben Gertzfield <che@debian.org> happy.

* gutils.c: Furthermore two warnings in gutils.c were voided,
which crept in due to my last change.

13 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in
glib.h
glib/glib.h
glib/gutils.c
gutils.c

index 83d15ab..7238aa2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
+       even when not needed by GLib. That's actually also the way, the
+       GLib reference manual describes that macro. Therefore I had to
+       remove the lonesome #include <glibconfig.h> in gutils.c, which
+       doesn't seem to be needed there however. This change should make
+       Ben Gertzfield <che@debian.org> happy.
+
+       * gutils.c: Furthermore two warnings in gutils.c were voided,
+       which crept in due to my last change.
+
        * gutils.c (g_get_current_dir): Allocate only up to 128KB for a
        pathname. While this is an arbitrary value just like 2048, it
        seems to be enough (after all, even 4GB is an arbitrary value).
index 83d15ab..7238aa2 100644 (file)
@@ -1,5 +1,15 @@
 2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
+       even when not needed by GLib. That's actually also the way, the
+       GLib reference manual describes that macro. Therefore I had to
+       remove the lonesome #include <glibconfig.h> in gutils.c, which
+       doesn't seem to be needed there however. This change should make
+       Ben Gertzfield <che@debian.org> happy.
+
+       * gutils.c: Furthermore two warnings in gutils.c were voided,
+       which crept in due to my last change.
+
        * gutils.c (g_get_current_dir): Allocate only up to 128KB for a
        pathname. While this is an arbitrary value just like 2048, it
        seems to be enough (after all, even 4GB is an arbitrary value).
index 83d15ab..7238aa2 100644 (file)
@@ -1,5 +1,15 @@
 2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
+       even when not needed by GLib. That's actually also the way, the
+       GLib reference manual describes that macro. Therefore I had to
+       remove the lonesome #include <glibconfig.h> in gutils.c, which
+       doesn't seem to be needed there however. This change should make
+       Ben Gertzfield <che@debian.org> happy.
+
+       * gutils.c: Furthermore two warnings in gutils.c were voided,
+       which crept in due to my last change.
+
        * gutils.c (g_get_current_dir): Allocate only up to 128KB for a
        pathname. While this is an arbitrary value just like 2048, it
        seems to be enough (after all, even 4GB is an arbitrary value).
index 83d15ab..7238aa2 100644 (file)
@@ -1,5 +1,15 @@
 2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
+       even when not needed by GLib. That's actually also the way, the
+       GLib reference manual describes that macro. Therefore I had to
+       remove the lonesome #include <glibconfig.h> in gutils.c, which
+       doesn't seem to be needed there however. This change should make
+       Ben Gertzfield <che@debian.org> happy.
+
+       * gutils.c: Furthermore two warnings in gutils.c were voided,
+       which crept in due to my last change.
+
        * gutils.c (g_get_current_dir): Allocate only up to 128KB for a
        pathname. While this is an arbitrary value just like 2048, it
        seems to be enough (after all, even 4GB is an arbitrary value).
index 83d15ab..7238aa2 100644 (file)
@@ -1,5 +1,15 @@
 2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
+       even when not needed by GLib. That's actually also the way, the
+       GLib reference manual describes that macro. Therefore I had to
+       remove the lonesome #include <glibconfig.h> in gutils.c, which
+       doesn't seem to be needed there however. This change should make
+       Ben Gertzfield <che@debian.org> happy.
+
+       * gutils.c: Furthermore two warnings in gutils.c were voided,
+       which crept in due to my last change.
+
        * gutils.c (g_get_current_dir): Allocate only up to 128KB for a
        pathname. While this is an arbitrary value just like 2048, it
        seems to be enough (after all, even 4GB is an arbitrary value).
index 83d15ab..7238aa2 100644 (file)
@@ -1,5 +1,15 @@
 2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
+       even when not needed by GLib. That's actually also the way, the
+       GLib reference manual describes that macro. Therefore I had to
+       remove the lonesome #include <glibconfig.h> in gutils.c, which
+       doesn't seem to be needed there however. This change should make
+       Ben Gertzfield <che@debian.org> happy.
+
+       * gutils.c: Furthermore two warnings in gutils.c were voided,
+       which crept in due to my last change.
+
        * gutils.c (g_get_current_dir): Allocate only up to 128KB for a
        pathname. While this is an arbitrary value just like 2048, it
        seems to be enough (after all, even 4GB is an arbitrary value).
index 83d15ab..7238aa2 100644 (file)
@@ -1,5 +1,15 @@
 2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
+       even when not needed by GLib. That's actually also the way, the
+       GLib reference manual describes that macro. Therefore I had to
+       remove the lonesome #include <glibconfig.h> in gutils.c, which
+       doesn't seem to be needed there however. This change should make
+       Ben Gertzfield <che@debian.org> happy.
+
+       * gutils.c: Furthermore two warnings in gutils.c were voided,
+       which crept in due to my last change.
+
        * gutils.c (g_get_current_dir): Allocate only up to 128KB for a
        pathname. While this is an arbitrary value just like 2048, it
        seems to be enough (after all, even 4GB is an arbitrary value).
index 83d15ab..7238aa2 100644 (file)
@@ -1,5 +1,15 @@
 2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
+       even when not needed by GLib. That's actually also the way, the
+       GLib reference manual describes that macro. Therefore I had to
+       remove the lonesome #include <glibconfig.h> in gutils.c, which
+       doesn't seem to be needed there however. This change should make
+       Ben Gertzfield <che@debian.org> happy.
+
+       * gutils.c: Furthermore two warnings in gutils.c were voided,
+       which crept in due to my last change.
+
        * gutils.c (g_get_current_dir): Allocate only up to 128KB for a
        pathname. While this is an arbitrary value just like 2048, it
        seems to be enough (after all, even 4GB is an arbitrary value).
index ebc5669..1ff844a 100644 (file)
@@ -1138,7 +1138,7 @@ _______EOF
 
        if test -n "$gint64"; then
          cat >>$outfile <<_______EOF
-${glib_warning_guard}#define G_HAVE_GINT64 1
+#define G_HAVE_GINT64 1
 
 ${glib_extension}typedef signed $gint64 gint64;
 ${glib_extension}typedef unsigned $gint64 guint64;
@@ -1348,7 +1348,6 @@ $ac_cv_sizeof_int)
   gint64_format='"i"'
   guint64_format='"u"'
   glib_extension=
-  glib_warning_guard=
   gint64_constant='(val)'
   ;;
 $ac_cv_sizeof_long)
@@ -1356,7 +1355,6 @@ $ac_cv_sizeof_long)
   gint64_format='"li"'
   guint64_format='"lu"'
   glib_extension=
-  glib_warning_guard=
   gint64_constant='(val##L)'
   ;;
 $ac_cv_sizeof_long_long)
@@ -1364,14 +1362,6 @@ $ac_cv_sizeof_long_long)
   gint64_format='"'$glib_cv_long_long_format'i"'
   guint64_format='"'$glib_cv_long_long_format'u"'
   glib_extension='G_GNUC_EXTENSION '
-  glib_warning_guard="
-#if defined (__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
-#  define G_GNUC_EXTENSION __extension__
-#else
-#  define G_GNUC_EXTENSION
-#endif
-
-"
   gint64_constant='(G_GNUC_EXTENSION (val##LL))'
   ;;
 esac
diff --git a/glib.h b/glib.h
index e4e6a63..b2a289a 100644 (file)
--- a/glib.h
+++ b/glib.h
@@ -1,4 +1,3 @@
-
 /* GLIB - Library of useful routines for C programming
  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
  *
 #ifndef __G_LIB_H__
 #define __G_LIB_H__
 
+/* Here we provide G_GNUC_EXTENSION as an alias for __extension__,
+ * where this is valid. This allows for warningless compilation of
+ * "long long" types even in the presence of '-ansi -pedantic'. This
+ * of course should be with the other GCC-isms below, but then
+ * glibconfig.h wouldn't load cleanly and it is better to have that
+ * here, than in glibconfig.h.  
+ */
+#if    __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
+#  define G_GNUC_EXTENSION __extension__
+#else
+#  define G_GNUC_EXTENSION
+#endif
+
 /* system specific config file glibconfig.h provides definitions for
  * the extrema of many of the standard types. These are:
  *
@@ -266,7 +278,6 @@ extern "C" {
 #define        G_GNUC_UNUSED
 #endif /* !__GNUC__ */
 
-
 /* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
  * macros, so we can refer to them as strings unconditionally.
  */
index e4e6a63..b2a289a 100644 (file)
@@ -1,4 +1,3 @@
-
 /* GLIB - Library of useful routines for C programming
  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
  *
 #ifndef __G_LIB_H__
 #define __G_LIB_H__
 
+/* Here we provide G_GNUC_EXTENSION as an alias for __extension__,
+ * where this is valid. This allows for warningless compilation of
+ * "long long" types even in the presence of '-ansi -pedantic'. This
+ * of course should be with the other GCC-isms below, but then
+ * glibconfig.h wouldn't load cleanly and it is better to have that
+ * here, than in glibconfig.h.  
+ */
+#if    __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
+#  define G_GNUC_EXTENSION __extension__
+#else
+#  define G_GNUC_EXTENSION
+#endif
+
 /* system specific config file glibconfig.h provides definitions for
  * the extrema of many of the standard types. These are:
  *
@@ -266,7 +278,6 @@ extern "C" {
 #define        G_GNUC_UNUSED
 #endif /* !__GNUC__ */
 
-
 /* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
  * macros, so we can refer to them as strings unconditionally.
  */
index a6784fe..a44c4fa 100644 (file)
@@ -32,8 +32,6 @@
 #include <config.h>
 #endif
 
-#include "glibconfig.h"
-
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -334,8 +332,8 @@ g_dirname (const gchar         *file_name)
 gchar*
 g_get_current_dir (void)
 {
-  gchar *buffer;
-  gchar *dir;
+  gchar *buffer = NULL;
+  gchar *dir = NULL;
   static gulong max_len = (G_PATH_LENGTH == -1) ? 2048 : G_PATH_LENGTH;
   
   /* We don't use getcwd(3) on SUNOS, because, it does a popen("pwd")
index a6784fe..a44c4fa 100644 (file)
--- a/gutils.c
+++ b/gutils.c
@@ -32,8 +32,6 @@
 #include <config.h>
 #endif
 
-#include "glibconfig.h"
-
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -334,8 +332,8 @@ g_dirname (const gchar         *file_name)
 gchar*
 g_get_current_dir (void)
 {
-  gchar *buffer;
-  gchar *dir;
+  gchar *buffer = NULL;
+  gchar *dir = NULL;
   static gulong max_len = (G_PATH_LENGTH == -1) ? 2048 : G_PATH_LENGTH;
   
   /* We don't use getcwd(3) on SUNOS, because, it does a popen("pwd")