FvwmProxy.c contains invalid C code. How-To-Repeat: Attempt to compile x11-wm/fvwm2-devel
Responsible Changed From-To: freebsd-ports-bugs->cy Over to maintainer
Here is an alternative patch which keeps the dx & dy calculations as they are but moves the declaration to be the first statement of the loop. Well, just see the patch below... - Parv --- FvwmProxy.c.old Wed Nov 2 01:08:12 2005 +++ FvwmProxy.c Wed Nov 2 01:08:46 2005 @@ -722,11 +722,13 @@ for (other=proxy->next; other; other=other->next) { + int dx, dy; + if(other->desk != deskNumber) continue; - int dx=abs(proxy->proxyx-other->proxyx); - int dy=abs(proxy->proxyy-other->proxyy); + dx=abs(proxy->proxyx-other->proxyx); + dy=abs(proxy->proxyy-other->proxyy); if (dx<(proxyWidth+proxySeparation) && dy<proxyHeight+proxySeparation ) {
In message <20051102211550.GA9325@holestein.holy.cow>, Parv writes: > in message <200511022013.jA2KDr3f067928@cwsys.cwsent.com>, > wrote Cy Schubert thusly... > > > > The C code in FvwmProxy.c is correct as this PR is only a problem > > when compiled using GCC 2.95.4 (FreeBSD 4.11). > > Yes, i personally did not observe any problems as GCC 3.4 (FreeBSD > 5.4) is used here; my interest in the PR is purely about gcc's > idiosyncrasies w/ C standard. > > > > 1. Maintain yet another patch (either this one or one that > > #ifdef's this patch or one I am considering). > > > > 2. Code an expectation of GCC level in the port's Makefile. I am > > especially partial to this approach as as it does not involve > > maintaining another patch to the original author's code. > > All i can say 4.x using poor souls (unless the heavy option of GCC > 3.4 port is exercised) would be left behind w/ the 2d option. Then > again if one reads Kris K's messages on related topic, 2d option can > be justified. I am partial to this and I will ask for kris@'s blessing in this regard. I'd rather do that than maintain more custom patches. I learned many years ago as an IBM mainframe MVS systems programmer that maintaining source code patches is expensive. I maintained 10,000 lines of source code patches to JES2, one of IBM's spooling subsystems. Every time a new release was installed I spent a month retrofitting and reworking patches and if it wasn't me some other poor soul had to spend the time doing it. Even though the 10,000 lines is an extreme example, I feel that this is a good policy even for a few lines. > > > > Let me reiterate, int dx=abs(...) is syntactically correct ANSI C. > > You will have no problem from me about that. > > > Please don't forget to followup with the PR's originator & the > -gnats-submit@freebsd as your reply seem to be addressed only to me. My bad. I hit the wrong button. I have a bad habit of doing that. I am currently testing USE_GCC=3.4+ on my 4.11 testbed. If that works I will test this on 5.4 and 6.0, then commit. Thanks for all of your input. -- Cheers, Cy Schubert <Cy.Schubert@komquats.com> Web: http://www.komquats.com and http://www.bcbodybuilder.com FreeBSD UNIX: <cy@FreeBSD.org> Web: http://www.FreeBSD.org BC Government: <Cy.Schubert@gov.bc.ca> "Lift long enough and I believe arrogance is replaced by humility and fear by courage and selfishness by generosity and rudeness by compassion and caring." -- Dave Draper
> Here is an alternative patch which keeps the dx & dy calculations as > they are but moves the declaration to be the first statement of the > loop. Well, just see the patch below... > > - Parv Looks reasonable. > --- FvwmProxy.c.old Wed Nov 2 01:08:12 2005 > +++ FvwmProxy.c Wed Nov 2 01:08:46 2005 > @@ -722,11 +722,13 @@ > > for (other=proxy->next; other; other=other->next) > { > + int dx, dy; > + > if(other->desk != deskNumber) > continue; > > - int dx=abs(proxy->proxyx-other->proxyx); > - int dy=abs(proxy->proxyy-other->proxyy); > + dx=abs(proxy->proxyx-other->proxyx); > + dy=abs(proxy->proxyy-other->proxyy); > if (dx<(proxyWidth+proxySeparation) && > dy<proxyHeight+proxySeparation ) > { -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews@isc.org
Just as a footnote. USE_GCC=3.4+ fixes the problem however it introduces another problem elsewhere. I will test the patch under 4.11, 5.4, and 6.0 before committing it. Cheers, Cy Schubert <Cy.Schubert@komquats.com> Web: http://www.komquats.com and http://www.bcbodybuilder.com FreeBSD UNIX: <cy@FreeBSD.org> Web: http://www.FreeBSD.org BC Government: <Cy.Schubert@gov.bc.ca> "Lift long enough and I believe arrogance is replaced by humility and fear by courage and selfishness by generosity and rudeness by compassion and caring." -- Dave Draper
State Changed From-To: open->closed Fixed, parv@'s patch committed.