In C++, you can have two functions with the same name in two different translation units and they can both do different things so long as they are static. You can also have two functions with the same name in two different namespaces and the implementations can also vary. I fail to see the issue. Defining macros or functions in a deeper directory serves a useful purpose because it provides a way of hiding macros that may be specific to only that directory from other directories. I have functions available in other directories which should not be accessible.<br>
<br>Is this a bug or a feature?<br><br><div class="gmail_quote">On Wed, Mar 4, 2009 at 1:43 AM, Michael Wild <span dir="ltr"><<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5"><br>
On 4. Mar, 2009, at 7:11, Robert Dailey wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, Mar 4, 2009 at 12:02 AM, Michael Wild <<a href="mailto:themiwi@gmail.com" target="_blank">themiwi@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If you add a subdirectory, it inherits all variables and macros from the<br>
parent directories. This is actually what one expects, otherwise you would<br>
have to repeat the whole system detection (find_pacakge, find_library,<br>
find_path etc.) in every subdirectory. The reverse, however is not true. By<br>
default, variables (I'm not sure about macros) don't propagate into the<br>
parent scope, unless one uses the PARENT_SCOPE option or adds the variable<br>
to the cache which makes it global.<br>
</blockquote>
<br>
<br>
That makes perfect sense and works as I would expect. However, I'm seeing<br>
the behavior you state should not happen. That is, the macros defined in the<br>
child directory are somehow propagating up to the parent.<br>
</blockquote>
<br></div></div>
Sorry, must have missed the bar/baz difference... Well, I figure it also makes some sense that macros and functions are global. Otherwise one would have very confusing things going on, like a macro by the same name doing completely unrelated things in different directories.<br>
<font color="#888888">
<br>
Michael<br>
</font></blockquote></div><br>