Re: suspicious error 'static declaration follows non-static declaration'

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

 



> I think it is about fixing a conceptual bug given the following example:
> 
> extern int i;  // external linkage
> int f() {
>   static int i;  // internal linkage
>   {
>     extern int i;  // external linkage before the change, internal
> linkage after the change
>   }
> }
> 
> I think the conceptual bug is because people expect the innermost i to
> follow the i whose enclosing scope is most immediate.
> 

Sorry for off-topic, but I see nothing wrong in your example. The
innermost i being redeclared is not related to the static i, so both
innermost and outermost i's represent the same object having external
linkage.


Andrew Makhorin




[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