[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 144150] New: C/CPP Preprocessor directives render the background
From:       "António" Oliveira <to.oliveira () gmail ! com>
Date:       2007-04-12 17:15:30
Message-ID: 20070412191524.144150.to.oliveira () gmail ! com
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=144150         
           Summary: C/CPP Preprocessor directives render the background
                    parser useless
           Product: kdevelop
           Version: 3.4.0
          Platform: unspecified
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: Language Support: CPP
        AssignedTo: kdevelop-bugs kdevelop org
        ReportedBy: to.oliveira gmail com


Version:           3.4.0 (using KDE 3.5.6, Kubuntu (feisty) 4:3.5.6-0ubuntu14)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.20-14-generic

This could be a WhishList instead, I leave up to you to decide that :-)

I'm using kdevelop 3.4 for C code. I have two sets of source files that I use for \
compilation using an #ifdef/#ifndef directive during compilation. When I'm editing \
the file with the #ifdef directive, the background parser stops immediatelly there \
because it assumes the code isn't going to be used after all. As a consequence, the \
browser toolbar shows no functions to choose from, which is annoying. Here's an \
example:

Let's assume I'm editing the file foo.c:

#ifdef __USE_FOO_C

void bar( int *baz )
{
 *baz=0;
}

#endif // defined(__USE_FOO_C)

The macro __USE_FOO_C is defined on compilation with the -D switch. Editing this file \
in kdevelop, I don't have the "bar( int *baz)" entry in the browser toolbar because \
the parser stopped in the preprocessor directive. 

If I change the #ifdef to #ifndef, after a second or so, I get the entry for "bar" in \
the browser toobar.

This is a dirty hack to bypass that behaviour but one can easily mess up the \
compilation if one forgets to restore the preprocessor directive.

This behaviour also applies to kdevelop 3.3.4 in ubuntu edgy

I'd like to see something like Ctags does, which is considering those chunks of code \
that are compiled conditionally, and result in showing two declarations for the same \
function a couple of times. That seems a more reasonable behaviour.

Thanks for such a great app.
cheers,
--to


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic