[PD-dev] [ pure-data-Bugs-1371511 ] declaration of `y1' shadows a global declaration

2006-11-01 Thread SourceForge.net
Bugs item #1371511, was opened at 2005-12-01 23:41
Message generated for change (Comment added) made by sf-robot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=478070aid=1371511group_id=55736

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: puredata
Group: None
Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Hans-Christoph Steiner (eighthave)
Assigned to: Miller Puckette (millerpuckette)
Summary: declaration of `y1' shadows a global declaration

Initial Comment:

When using math.h on Darwin, the y1 variable causes
lots of warnings.

../../pd/src/g_canvas.h:247: warning: declaration of
`y1' shadows a global declaration
/usr/include/architecture/ppc/math.h:483: warning:
shadowed declaration is here

Renaming y1 in g_canvas.h would fix this problem.

--

Comment By: SourceForge Robot (sf-robot)
Date: 2006-11-01 19:20

Message:
Logged In: YES 
user_id=1312539

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

--

Comment By: Mathieu Bouchard (matju)
Date: 2006-10-18 06:47

Message:
Logged In: YES 
user_id=801174

Whatever about calling functions y0,y1,yn, they've been
there since almost the beginning of unix. They're Bessel
functions defined in math.h. You won't be able to move
them out of it. This suggests that the -Wshadow warning is
of questionable use. I'd turn it off, personally.


--

Comment By: IOhannes m zm�lnig (zmoelnig)
Date: 2006-10-18 01:33

Message:
Logged In: YES 
user_id=564396

a) has this been fixed already? (i cannot reproduce this
anymore; also the pd(-extended) buildlogs do not show this
warning)
b) i don't think that this is a bug in pd; no global include
file (/usr/include/architecture/ppc/math.h) should use
global variable names like i, y1 and the like.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=478070aid=1371511group_id=55736

___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] [ pure-data-Bugs-1371511 ] declaration of `y1' shadows a global declaration

2006-10-19 Thread IOhannes m zmoelnig

Hans-Christoph Steiner wrote:


I think its a really bad idea to name functions using names that have 
existing in standard headers for decades, especially when that header is 


i do not recall any function in pd with a name y1().
it is a simple stupid variable, with a _quite_ descriptive name (e.g. 
upperleft_y would be more descriptive)


used in the same project.  So must more C devs since gcc warns of this 
condition by default.  The warning should stay so that we don't get more 
such conditions.


well, having variable shadowing others is not the end of the world.
one of the benefits of variable shadowing is locality. at the same time 
this is it's curse.


after all, we have been discussing to get a similar mechanism into pd 
for ages (think namespaces without prefixes!). maybe we should rethink this.



fixed soon doesn't seem like the good solution to me.  Instead it should 
be set to Postponed, later, Remind, Wont Fix, something that 
communicates why its being ignored and makes it easy to find in the future.


i am with you.

mfga.sdr
IOhannes

___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] [ pure-data-Bugs-1371511 ] declaration of `y1' shadows a global declaration

2006-10-19 Thread Hans-Christoph Steiner


On Oct 19, 2006, at 4:02 AM, IOhannes m zmoelnig wrote:


Hans-Christoph Steiner wrote:
I think its a really bad idea to name functions using names that  
have existing in standard headers for decades, especially when  
that header is


i do not recall any function in pd with a name y1().
it is a simple stupid variable, with a _quite_ descriptive name  
(e.g. upperleft_y would be more descriptive)


Its a variable, but its in g_canvas.h, so its public.  I  
wholeheartedly agree that variables/functions should have more  
descriptive names and y1 is not that.


used in the same project.  So must more C devs since gcc warns of  
this condition by default.  The warning should stay so that we  
don't get more such conditions.


well, having variable shadowing others is not the end of the world.
one of the benefits of variable shadowing is locality. at the same  
time this is it's curse.


after all, we have been discussing to get a similar mechanism into  
pd for ages (think namespaces without prefixes!). maybe we should  
rethink this.


If it happens that you need to use math.h's y1 and g_canvas.h is also  
included in your .c file, this could get quite annoying.  Does not  
make for readable code.  I can't see any benefits...


.hc




fixed soon doesn't seem like the good solution to me.  Instead it  
should be set to Postponed, later, Remind, Wont Fix,  
something that communicates why its being ignored and makes it  
easy to find in the future.


i am with you.

mfga.sdr
IOhannes

___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev





If nature has made any one thing less susceptible than all others of  
exclusive property, it is the action of the thinking power called an  
idea, which an individual may exclusively possess as long as he keeps  
it to himself; but the moment it is divulged, it forces itself into  
the possession of everyone, and the receiver cannot dispossess  
himself of it.- Thomas Jefferson




___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] [ pure-data-Bugs-1371511 ] declaration of `y1' shadows a global declaration

2006-10-18 Thread IOhannes m zmoelnig

SourceForge.net wrote:


Comment By: Mathieu Bouchard (matju)
Date: 2006-10-18 09:47

Whatever about calling functions y0,y1,yn, they've been
there since almost the beginning of unix. They're Bessel
functions defined in math.h. You won't be able to move
them out of it. 


oh, i see. i didn't know that bessel-functions are in math.h.
nevertheless i think it was a very stupid thing to call them y1() or the 
like in the first place (but i agree, that this cannot be changed any more).



This suggests that the -Wshadow warning is
of questionable use. I'd turn it off, personally.


right, that was suggestion c) which mysteriously vanished.


fma.dr
IOhannes

___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev