sane-project-website/old-archive/1998-11/0204.html

71 wiersze
3.5 KiB
HTML

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!-- received="Sun Nov 22 10:57:59 1998 PST" -->
<!-- sent="Sun, 22 Nov 1998 14:02:13 -0500" -->
<!-- name="David Huggins-Daines" -->
<!-- email="bn711@freenet.carleton.ca" -->
<!-- subject="Re: compiling problem with egcs-1.03a" -->
<!-- id="" -->
<!-- inreplyto="199811221748.JAA00334@panda.mostang.com" -->
<title>sane-devel: Re: compiling problem with egcs-1.03a</title>
<h1>Re: compiling problem with egcs-1.03a</h1>
<b>David Huggins-Daines</b> (<a href="mailto:bn711@freenet.carleton.ca"><i>bn711@freenet.carleton.ca</i></a>)<br>
<i>Sun, 22 Nov 1998 14:02:13 -0500</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#204">[ date ]</a><a href="index.html#204">[ thread ]</a><a href="subject.html#204">[ subject ]</a><a href="author.html#204">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0205.html">Danilo Godec: "Re: The Primax Scanner Driver Project for Linux/UN*X homepage started"</a>
<li> <b>Previous message:</b> <a href="0203.html">David Mosberger-Tang: "Re: Problems compiling sane-1.00"</a>
<li> <b>In reply to:</b> <a href="0201.html">David Mosberger-Tang: "Re: compiling problem with egcs-1.03a"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
On Sun, Nov 22, 1998 at 09:48:51AM -0800, David Mosberger-Tang wrote:<br>
<i>&gt; Here's a trivial fix (I'm guessing that it'll fix the problem):</i><br>
<i>&gt; </i><br>
<i>&gt; --- backend/abaton.c~ Sat Nov 21 18:54:14 1998</i><br>
<i>&gt; +++ backend/abaton.c Sun Nov 22 09:42:23 1998</i><br>
<i>&gt; @@ -1113,7 +1113,7 @@</i><br>
<i>&gt; </i><br>
<i>&gt; case OPT_Y_RESOLUTION:</i><br>
<i>&gt; if (s-&gt;val[OPT_PREVIEW].w || s-&gt;val[OPT_RESOLUTION_BIND].w) {</i><br>
<i>&gt; - s-&gt;val[OPT_X_RESOLUTION] = *(SANE_Word *)val;</i><br>
<i>&gt; + s-&gt;val[OPT_X_RESOLUTION].w = *(SANE_Word *)val;</i><br>
<i>&gt; if (info)</i><br>
<i>&gt; *info |= SANE_INFO_RELOAD_OPTIONS;</i><br>
<i>&gt; }</i><br>
<i>&gt; </i><br>
<i>&gt; However, I think the real bug may be in egcs-1.03a. I thought ANSI C</i><br>
<i>&gt; allows such assignments to the first member of a union (or is this</i><br>
<i>&gt; supposed to be allowed for union initialization only?).</i><br>
<p>
Oh, crud. I goofed. I don't know if it's required by ANSI or not, but<br>
it's just plain wrong anyway. I'm very surprised that gcc -Wall didn't<br>
catch it!<br>
<p>
Please apply the fix above, I have tested it and it solves the problem<br>
(this is the only place where I forgot to add the union member...)<br>
<p>
<pre>
--
use strict;print&amp;{sub{my(@q)=@_;&amp;{sub{my($p)=@_;&amp;$p($p,@q);}}(sub{my($p)=shift;
@_&amp;&amp;($_[0][0].":".(ref $_[0][1]?"\n".&amp;$p($p,@{$_[0][1]}):$_[0][1])."\n".(&amp;$p(
$p,@_[1..$#_])||''));});}}([name=&gt;'David Huggins-Daines'],[email=&gt;'bn711@free'.
'net.carleton.ca'],[occupation=&gt;[[by_day=&gt;'linguist'],[by_night=&gt;'hacker']]]);
<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">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0205.html">Danilo Godec: "Re: The Primax Scanner Driver Project for Linux/UN*X homepage started"</a>
<li> <b>Previous message:</b> <a href="0203.html">David Mosberger-Tang: "Re: Problems compiling sane-1.00"</a>
<li> <b>In reply to:</b> <a href="0201.html">David Mosberger-Tang: "Re: compiling problem with egcs-1.03a"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>