[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new module 'c++defs'
From: |
John W. Eaton |
Subject: |
Re: new module 'c++defs' |
Date: |
Sun, 7 Mar 2010 05:21:17 -0500 |
On 6-Mar-2010, Bruno Haible wrote:
| John W. Eaton wrote:
| > How can one easily find all the places where the GNULIB_NAMESPACE tag
| > is needed? Is there some way we can get the compiler to help with
| > this job?
|
| Good point. I'm adding a macro _GL_CXXALIASWARN, so that a warning will
| be emitted:
|
| foo.cc: In function ‘int main()’:
| foo.cc:21: warning: call to ‘open’ declared with attribute warning: The
symbol ::open refers to the system function. Use gnulib::open instead.
Will this warning happen on all systems when a module is used, or just
when the replacement function is needed? For example, if I'm doing
development on a GNU system that doesn't need many replacement
functions, will I see the warnings, or will I only know about these
problems once someone attempts a build on a system like Windows that
actually needs the replacement functions? How does this macro avoid
causing trouble with things like myclass::open? I guess I would
have a better understanding if I could see your latest version of the
code. Are your updated changes available somewhere for testing?
| > Is there some reason to not add using directives in the gnulib
| > headers for each system function that is placed in the gnulib::
| > namespace?
| > Oh, now I remember that doing this requires placing the system headers
| > inside a namespace, and I guess that could cause some trouble. But
| > would you be interested in trying it? I could do the testing and help
| > with making the required changes.
|
| You can try it. But I doubt that you will get to a portable solution
| this way, because of differences between various C++ compilers.
OK. It's not that important to me to attempt this as long as there is
some way to be notified when a symbol is used and needs to be tagged
with the namespace.
Thanks,
jwe