Bug 11678 - --disable-verbose-mode for non c99 non-gcc compilers
Summary: --disable-verbose-mode for non c99 non-gcc compilers
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-20 17:41 UTC by Peter O'Gorman, The Written Word, Inc.
Modified: 2007-10-03 14:54 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Peter O'Gorman, The Written Word, Inc. 2007-07-20 17:41:18 UTC
Now, there is a #error in dbus-internals.h that says "error "This compiler does not support varargs macros and thus verbose mode can't be disabled meaningfully".

How about instead having:
static void _dbus_verbose(const char x, ...) {;}

which should, I hope, be optimized away by most compilers.

Index: dbus/dbus-internals.h
===================================================================
--- dbus/dbus-internals.h.orig  2006-12-11 19:21:10.000000000 +0000
+++ dbus/dbus-internals.h       2007-07-21 00:33:52.252644787 +0000
@@ -97,7 +97,7 @@
 #  elif defined (HAVE_GNUC_VARARGS)
 #    define _dbus_verbose(format...)
 #  else
-#    error "This compiler does not support varargs macros and thus verbose mode can't be disabled meaningfully"
+static void _dbus_verbose(const char * x,...) {;}
 #  endif
 #  define _dbus_verbose_reset()
 #  define _dbus_is_verbose() FALSE
Comment 1 Peter O'Gorman, The Written Word, Inc. 2007-07-20 18:02:09 UTC
Note that, even if the compiler is not as smart as in my dreams, this method allows us to use the same configure options on all plarforms, without the older ones spitting errors.
Comment 2 Havoc Pennington 2007-07-22 08:15:43 UTC
Makes sense to me, yep.
Comment 3 John (J5) Palmieri 2007-10-03 14:54:47 UTC
pushed to git


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.