It's not a collision, it's a shadow. Means that within the scope of that
declaration, 'socket' is actually a different variable. Once it goes out of
scope, the variable reverts to the original. Where you get bit is assuming
the hidden variable is being used (initialized) or the value you set carries
forward, as in this pseudo code:
With a {
Socket = 1
With b {
If (Socket == 1) ! fails as it's uninitialzed
Then Socket = 2
Print Socket ! gives 2
}
Print Socket ! gives 1
}
-----Burton
From: [email protected] [mailto:[email protected]] On Behalf Of Gary
Gatten
Sent: Friday, May 08, 2009 8:50 AM
To: [email protected]; [email protected]
Subject: [Ntop] shadowed declaration warnings during compile
I get a $hit load of these warnings when compiling; similar to:
/usr/local/include/evdns.h:510: warning: declaration of 'socket' shadows a
global declaration
/usr/include/sys/socket.h:576: warning: shadowed declaration is here
My limited development experience tells me strange things happen when
variables collide, do I need to worry about these warnings?
"This email is intended to be reviewed by only the intended recipient and
may contain information that is privileged and/or confidential. If you are
not the intended recipient, you are hereby notified that any review, use,
dissemination, disclosure or copying of this email and its attachments, if
any, is strictly prohibited. If you have received this email in error,
please immediately notify the sender by return email and delete this email
from your system."
_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev