| Last change
 on this file since 318 was             313, checked in by bird, 22 years ago | 
        
          | 
Made gcc not optimize away that static.
 | 
        
          | 
              
Property                 cvs2svn:cvs-rev
 set to                 1.3
Property                 svn:eol-style
 set to                 native
Property                 svn:executable
 set to                 *
Property                 svn:keywords
 set to                 Author Date Id Revision | 
        
          | File size:
            434 bytes | 
      
      
| Line |  | 
|---|
| 1 | static int  fileglobal = 2; | 
|---|
| 2 | int         realglobal = 1; | 
|---|
| 3 |  | 
|---|
| 4 |  | 
|---|
| 5 | int foo(int i, int j) | 
|---|
| 6 | { | 
|---|
| 7 | static int myVar = 0; | 
|---|
| 8 | static int myVar2; | 
|---|
| 9 |  | 
|---|
| 10 | if (myVar++) | 
|---|
| 11 | { | 
|---|
| 12 | int scope; | 
|---|
| 13 |  | 
|---|
| 14 | return scope + myVar + myVar2; | 
|---|
| 15 | } | 
|---|
| 16 | myVar2++; | 
|---|
| 17 | return 0; | 
|---|
| 18 | } | 
|---|
| 19 |  | 
|---|
| 20 | static int bar(int i, int j) | 
|---|
| 21 | { | 
|---|
| 22 | return i+j; | 
|---|
| 23 | } | 
|---|
| 24 |  | 
|---|
| 25 | void stub(void) | 
|---|
| 26 | { | 
|---|
| 27 | } | 
|---|
| 28 |  | 
|---|
| 29 | int main(int argc, char **argv) | 
|---|
| 30 | { | 
|---|
| 31 | int i; | 
|---|
| 32 | i = foo(1, 2); | 
|---|
| 33 | i += bar(1, 2); | 
|---|
| 34 | stub(); | 
|---|
| 35 | return i; | 
|---|
| 36 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.