Bug 87886 - x11-wm/fvwm2-devel: fvwm-2.5.14 FvwmProxy.c syntactically invalid C code
Summary: x11-wm/fvwm2-devel: fvwm-2.5.14 FvwmProxy.c syntactically invalid C code
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-23 23:30 UTC by Mark Andrews
Modified: 2005-11-09 16:51 UTC (History)
0 users

See Also:


Attachments
file.diff (514 bytes, patch)
2005-10-23 23:30 UTC, Mark Andrews
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Andrews 2005-10-23 23:30:16 UTC
	FvwmProxy.c contains invalid C code.

How-To-Repeat: 	
	Attempt to compile x11-wm/fvwm2-devel
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2005-10-23 23:37:47 UTC
Responsible Changed
From-To: freebsd-ports-bugs->cy

Over to maintainer
Comment 2 parv 2005-11-02 17:48:15 UTC
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 )
 		{
Comment 3 Cy Schubert 2005-11-02 21:54:51 UTC
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
Comment 4 Mark Andrews 2005-11-03 02:50:54 UTC
> 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
Comment 5 Cy Schubert 2005-11-03 03:40:36 UTC
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
Comment 6 Cy Schubert freebsd_committer freebsd_triage 2005-11-09 16:50:40 UTC
State Changed
From-To: open->closed

Fixed, parv@'s patch committed.