Re: Global Definition Vs Global Declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> OK, I actually tried it.  When I try this with current mainline, I see
> that DECL_EXTERNAL is set for "extern int j;" and is not set for "int
> i;".  Also TREE_STATIC is set for "int i;" but not for "extern int j;".

Hmm strange. I am not sure if I am doing this wrong. Here's the sample
code that I am running this on:

// Global decls
static int staticint;
extern int extint;
int globalint;

int main(void)
{
    int a[10],i, *p;
    globalint=0;
    return 1;
}

And here is the output from the plugin code:

Glob var: staticint   decl_external:0 tree_static:1 complete:1 common: 0
Glob var: extint      decl_external:1 tree_static:0 complete:1 common: 1
Glob var: globalint decl_external:1 tree_static:0 complete:1 common: 1

decl_external is set for both globalint and extint. I am trying this
with 4.6.2 source.

Thanks for your time. Appreciate it.

Zahed



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux