Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - namespace related bugs: (4 Items)
   
namespace related bugs  
The following simple examples reveal header bugs in QNX 6.4.0 when compiled with QCC (no options).

#include <cwchar>

int main()
{
 wchar_t c = WEOF; // error: 'wint_t' was not declared in this scope
 return 0;
}

The WEOF macro assumes wint_t is accessible without specifying std:: which is not necessarily the case.

#include <cstdarg>

int main()
{
 std::va_list list; //error: 'va_list' is not a member of 'std'
 return 0;
}

Just for reference, allow me to quote the C++ standard:
"..the contents of each header cname shall be the same as that of the corresponding header name.h, as specified in the 
C99 standard Library ... as appropriate, as if by inclusion. In the C++ standard library, however, the declarations 
(except for names which are defined as macros in C) are within namespace scope of the namespace std. It is unspecified 
whether these names are first declared within the global namespace scope and are then injected into namespace std by 
explicit using-declarations."
Re: namespace related bugs  
Hi Niklas,

I've forwarded this on to our toolchain folks to see what they have to say.

They mostly hang out in the Core Development Tools forum over at

  http://community.qnx.com/sf/discussion/do/listTopics/projects.toolchai/discussion.core_development_tools/

Regards,
Neil
Re: namespace related bugs  
I can not find the thread in another forum.

The issue is still present in 6.4.1.

A possible workaround for va_list may be this:

namespace std{
     using ::va_list;
} // namespace std
Re: namespace related bugs  
This was fixed for 6.5.0, revision 274488 of trunk/lib/c/public/stdarg.h

On 10-03-23 2:26 PM, Christian Leutloff wrote:
> I can not find the thread in another forum.
>
> The issue is still present in 6.4.1.
>
> A possible workaround for va_list may be this:
>
> namespace std{
>       using ::va_list;
> } // namespace std
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post50266
>
>    

-- 
cburgess@qnx.com