Bug 53344 - C++ Parser incorrect in #define environments
Summary: C++ Parser incorrect in #define environments
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: kdevelop 2.x (obsolete) (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop-Devel List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-24 12:26 UTC by Christoph Bartoschek
Modified: 2003-01-24 15:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Bartoschek 2003-01-24 12:26:20 UTC
Version:           Gideon (using KDE KDE 3.0.99)
Installed from:    Compiled From Sources
Compiler:          g++ 3.2 
OS:          Linux

If you have a funtion which looks like this

void hulgo
#ifdef HUHU
   (int a, int b)
#else
   (int a, int b, int c)
#endif
{
   if (a == b) return true;
}

Gideon sees two funtions:

void hulgo( int a, int b )
if ( a )

I don't know how this should be parsed, but if ( a ) should not appear.

Another point: 
in kdevelop/parts/appwizard/imports/cpp.kdevelop I find:

  <ignoreparts>
   <part>KDevFileView</part>
  </ignoreparts>

Why do you ignore KDeVFileView? I have to comment this out in the resulting .kdevelop file
Comment 1 Harald Fernengel 2003-01-24 15:24:47 UTC
grrr... if I ever catch you commit such code into KDE CVS.... 
 
You could at least write it as: 
 #ifdef HUHU  
void hulgo (int a, int b)  
 #else  
void hulgo (int a, int b, int c)  
 #endif  
 
so that it is at least a but more readable when you look at your code again in a few 
weeks. 
 
But I won't argue about coding style now, at least the above should fix the 
class-view. Since KDevelop doesn't contain a pre-processor, it is very difficult to 
support #defines, it might be included in a future version. If you really really think it 
should be there, please file a wishlist item. 
 
As for the ignore-parts: You can enable it in Project -> Options -> Plugins. We have 
so many file-views that we thought we disable that one.