Re: compiling problem with egcs-1.03a

David Huggins-Daines (bn711@freenet.carleton.ca)
Sun, 22 Nov 1998 14:02:13 -0500

On Sun, Nov 22, 1998 at 09:48:51AM -0800, David Mosberger-Tang wrote:
> Here's a trivial fix (I'm guessing that it'll fix the problem):
>
> --- backend/abaton.c~ Sat Nov 21 18:54:14 1998
> +++ backend/abaton.c Sun Nov 22 09:42:23 1998
> @@ -1113,7 +1113,7 @@
>
> case OPT_Y_RESOLUTION:
> if (s->val[OPT_PREVIEW].w || s->val[OPT_RESOLUTION_BIND].w) {
> - s->val[OPT_X_RESOLUTION] = *(SANE_Word *)val;
> + s->val[OPT_X_RESOLUTION].w = *(SANE_Word *)val;
> if (info)
> *info |= SANE_INFO_RELOAD_OPTIONS;
> }
>
> However, I think the real bug may be in egcs-1.03a. I thought ANSI C
> allows such assignments to the first member of a union (or is this
> supposed to be allowed for union initialization only?).

Oh, crud. I goofed. I don't know if it's required by ANSI or not, but
it's just plain wrong anyway. I'm very surprised that gcc -Wall didn't
catch it!

Please apply the fix above, I have tested it and it solves the problem
(this is the only place where I forgot to add the union member...)

-- 
use strict;print&{sub{my(@q)=@_;&{sub{my($p)=@_;&$p($p,@q);}}(sub{my($p)=shift;
@_&&($_[0][0].":".(ref $_[0][1]?"\n".&$p($p,@{$_[0][1]}):$_[0][1])."\n".(&$p(
$p,@_[1..$#_])||''));});}}([name=>'David Huggins-Daines'],[email=>'bn711@free'.
'net.carleton.ca'],[occupation=>[[by_day=>'linguist'],[by_night=>'hacker']]]);

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com