Work around MinGW mangling of "host:/path"
[msysgit/historical-msysgit.git] / mingw / info / stabs / Based-Variables.html
blob66b12ae5b4573b7efa95170e1533d676c269d89b
1 <html lang="en">
2 <head>
3 <title>STABS</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="STABS">
6 <meta name="generator" content="makeinfo 4.3">
7 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
8 </head>
9 <body>
10 <div class="node">
11 <p>
12 Node:<a name="Based%20Variables">Based Variables</a>,
13 Next:<a rel="next" accesskey="n" href="Parameters.html#Parameters">Parameters</a>,
14 Previous:<a rel="previous" accesskey="p" href="Statics.html#Statics">Statics</a>,
15 Up:<a rel="up" accesskey="u" href="Variables.html#Variables">Variables</a>
16 <hr><br>
17 </div>
19 <h3 class="section">Fortran Based Variables</h3>
21 <p>Fortran (at least, the Sun and SGI dialects of FORTRAN-77) has a feature
22 which allows allocating arrays with <code>malloc</code>, but which avoids
23 blurring the line between arrays and pointers the way that C does. In
24 stabs such a variable uses the <code>b</code> symbol descriptor.
26 <p>For example, the Fortran declarations
28 <pre class="example"> real foo, foo10(10), foo10_5(10,5)
29 pointer (foop, foo)
30 pointer (foo10p, foo10)
31 pointer (foo105p, foo10_5)
32 </pre>
34 <p>produce the stabs
36 <pre class="example"> foo:b6
37 foo10:bar3;1;10;6
38 foo10_5:bar3;1;5;ar3;1;10;6
39 </pre>
41 <p>In this example, <code>real</code> is type 6 and type 3 is an integral type
42 which is the type of the subscripts of the array (probably
43 <code>integer</code>).
45 <p>The <code>b</code> symbol descriptor is like <code>V</code> in that it denotes a
46 statically allocated symbol whose scope is local to a function; see
47 See <a href="Statics.html#Statics">Statics</a>. The value of the symbol, instead of being the address
48 of the variable itself, is the address of a pointer to that variable.
49 So in the above example, the value of the <code>foo</code> stab is the address
50 of a pointer to a real, the value of the <code>foo10</code> stab is the
51 address of a pointer to a 10-element array of reals, and the value of
52 the <code>foo10_5</code> stab is the address of a pointer to a 5-element array
53 of 10-element arrays of reals.
55 </body></html>