sane-project-website/old-archive/2000-10/0185.html

136 wiersze
4.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: Re: bug in sanei_debug.h</TITLE>
<META NAME="Author" CONTENT="Henning Meier-Geinitz (hmg-ml@gmx.de)">
<META NAME="Subject" CONTENT="Re: bug in sanei_debug.h">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: bug in sanei_debug.h</H1>
<!-- received="Tue Oct 17 11:46:49 2000" -->
<!-- isoreceived="20001017184649" -->
<!-- sent="Sun, 15 Oct 2000 21:44:13 +0200" -->
<!-- isosent="20001015194413" -->
<!-- name="Henning Meier-Geinitz" -->
<!-- email="hmg-ml@gmx.de" -->
<!-- subject="Re: bug in sanei_debug.h" -->
<!-- id="20001015214413.A315@vortex.swb.de" -->
<!-- inreplyto="39E9F3CC.C5B3CEB1@gno.de" -->
<STRONG>From:</STRONG> Henning Meier-Geinitz (<A HREF="mailto:hmg-ml@gmx.de?Subject=Re:%20bug%20in%20sanei_debug.h&In-Reply-To=&lt;20001015214413.A315@vortex.swb.de&gt;"><EM>hmg-ml@gmx.de</EM></A>)<BR>
<STRONG>Date:</STRONG> Sun Oct 15 2000 - 12:44:13 PDT
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0186.html">Henning Meier-Geinitz: "Re: SANE can't see Epson Perfection 1200S"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0184.html">Denny Schanze: "Re:access denied"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0158.html">Jochen Eisinger: "Re: bug in sanei_debug.h"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0179.html">Petter Reinholdtsen: "Re: bug in sanei_debug.h"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#185">[ date ]</A>
<A HREF="index.html#185">[ thread ]</A>
<A HREF="subject.html#185">[ subject ]</A>
<A HREF="author.html#185">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Hi,
<BR>
<P>On Sun, Oct 15, 2000 at 08:13:32PM +0200, Jochen Eisinger wrote:
<BR>
<EM>&gt; There's another bug in sanei_debug.h: before we test what value __GNUC__
</EM><BR>
<EM>&gt; has, we should test, whether __GNUC__ is defined at all.
</EM><BR>
<P>I'm not sure but I think this was done intentionally. The code is:
<BR>
<P>#if __GNUC__ - 0 &gt; 2 || (__GNUC__ - 0 == 2 &amp;&amp; __GNUC_MINOR__ &gt; 5)
<BR>
<P>With __GNUC__ undefined this will expand to
<BR>
<P>#if 0 - 0 &gt; 2 || (0 - 0 == 2 &amp;&amp; 0 &gt; 5)
<BR>
<P>(At least this is what the gnu cpp manual says, I hope this is true for
<BR>
other preprocessors).
<BR>
<P>I don't know why the code uses __GNUC__ - 0, maybe this is when __GNUC__ is
<BR>
defined but empty?
<BR>
<P>But you are right that
<BR>
<P>#ifdef __GNUC__
<BR>
# if __GNUC__ ...
<BR>
<P>is easier to understand and maybe more portable (I haven't heard of problems
<BR>
on any platform about this line, however). So I think you can change this.
<BR>
<P><EM>&gt; I had a look at it. I thought, we could define DBG like this
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; #define DBG sanei_debug_set(DBG_LEVEL, STRINGIFY(BACKEND_NAME));
</EM><BR>
<EM>&gt; sanei_debug
</EM><BR>
<P>This was my first idea, too.
<BR>
<P><EM>&gt; but this fails on code like this
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; if (...)
</EM><BR>
<EM>&gt; DBG(...)
</EM><BR>
<EM>&gt; else
</EM><BR>
<EM>&gt; ...
</EM><BR>
<P>Exactly. Probably other persons thought about this problem years ago with no
<BR>
result ...
<BR>
<P>Bye,
<BR>
&nbsp;&nbsp;Henning
<BR>
<P><PRE>
--
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20bug%20in%20sanei_debug.h&In-Reply-To=&lt;20001015214413.A315@vortex.swb.de&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0186.html">Henning Meier-Geinitz: "Re: SANE can't see Epson Perfection 1200S"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0184.html">Denny Schanze: "Re:access denied"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0158.html">Jochen Eisinger: "Re: bug in sanei_debug.h"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0179.html">Petter Reinholdtsen: "Re: bug in sanei_debug.h"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#185">[ date ]</A>
<A HREF="index.html#185">[ thread ]</A>
<A HREF="subject.html#185">[ subject ]</A>
<A HREF="author.html#185">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Tue Oct 17 2000 - 11:47:26 PDT</EM>
</EM>
</SMALL>
</BODY>
</HTML>