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

List:       kde-commits
Subject:    Re: kdegraphics/kolourpaint
From:       André_Wöbbeking <Woebbeking () onlinehome ! de>
Date:       2005-02-03 10:44:53
Message-ID: 200502031144.53996.Woebbeking () onlinehome ! de
[Download RAW message or body]

On Thursday 03 February 2005 11:15, Dirk Mueller wrote:
> On Thursday 03 February 2005 11:08, André Wöbbeking wrote:
> > About the static I'm not sure. I only added it to hide the symbol
> > from the lib/app.
>
> well, if there is a symbol, there *has* to be an allocation.. the
> symbol cannot point nowhere..

I tried

static const bool ddddd = false;
int main()
{
    int i = 0;
    if (ddddd)
        i = 5;

    return i;
}

With GCC 3.4 and -O2 (the static doesn't matter) ddddd isn't in the 
symbol table (I used nm -C). With ddddd = false the resulting code is 
return 0 with ddddd = true return 5 (no conditional jumps).

> but the static could make a difference. However I wouldn't be
> surprised to see it still ending up in the executable because of some
> weird compliance issue. why else would gcc warn about "warning:
> defined but not used" in such cases if it can just omit it?

With const bool I got no warning. I had to remove the const to get the 
warning.


André

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

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