problem during parse of namespace with C-Header extern "C" included

Achim Spangler spangler at
Mon Mar 20 13:11:05 UTC 2000

Hi, throws an 
ASSERT: "lexem == '}'" in (383)

in a header file, where I define TWO namespaces like the following:

namespace nam1
{ // start of namespace recognized as nam1
  #if defined(DEF_1)
    extern "C" {
      #include "header_1.h"
  #elif defined(DEF_2)
    extern "C" {
      #include "header_2.h"
namespace nam2
  // some inline functions
} // end of namespace recognized as nam1(!)

I tried to replace some "}" with "};" but one time
complains about errors and some other time the API generation complains
about undefined decls.

Interesting test information:
I checked for the code line, where ClassParser see begin and end of
namespace (by inserting cout getLineno() in
CClassParser::parseNamespace(CParsedScopeContainer* scope) )
==> only namespace nam1 is recognized starting and ending at the
commented positions
==> I suspect that the parser is confused by the "{" and "}" of the
extern "C" block

Dipl.-Inform. Achim Spangler                TUM Freising-Weihenstephan
Tel.:  +49-8161-71 3565                     Institut fuer Landtechnik
Fax.:  +49-8161-71 3895                     Am Staudengarten 2
Email: spangler at    85350 Freising
=-=-=-=-=-=-=-=-=-=-=-Agricultural BUS System (LBS)-=-=-=-=-=-=-=-=-=-=-

More information about the KDevelop mailing list