This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: abs function question
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: sje at cup dot hp dot com
- Date: Mon, 28 Jul 2003 20:52:10 -0500 (CDT)
- Subject: Re: abs function question
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
> I am currently running into a problem with the function abs and the
> header std_cstdlib.h. This file contains the lines:
>
> namespace std
> {
> using ::abs
> }
>
> The problem is that my system's stdlib.h header file is smart enough to
> not do an extern declaration for abs if it is in C++ mode and instead
> does an inline declaration of the abs function. It only does an extern
> declaration if it is in C mode. Thus I get an error on the 'using ::abs'
> line. [...proposed fix removed for the moment...]
Hi Steve,
Could I get some more information on this problem before we hack the
library or you add a fixinclude? ;-)
The line of code in question has been present since Jan 02. How long
have you seen this problem on mainline?
Does the standard say that ``using ::abs'' will not pull an inline
into the new namespace scope exactly as it would an extern? I'm
surprised to hear that. I.e. the following compiles for me with
mainline:
inline void a(void) {}
namespace std { using ::a; }
Thus, I'm wondering what is different in your case. Could you post
for us the exact declaration found in your system's <stdlib.h> in C++
mode?
Regards,
Loren