Changeset fe6047c for doc/theses/mike_brooks_MMath/background.tex
- Timestamp:
- Dec 12, 2025, 12:18:17 PM (4 months ago)
- Branches:
- master, stuck-waitfor-destruct
- Children:
- 67748f9, 79ba50c
- Parents:
- f2b74e3
- File:
-
- 1 edited
-
doc/theses/mike_brooks_MMath/background.tex (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/background.tex
rf2b74e3 rfe6047c 620 620 In fact, the outermost type constructor (syntactically first dimension) is really the one that determines the parameter flavour. 621 621 622 \PAB{TODO: add examples of mycode/arrr/bugs/c-dependent/x.cfa:v5102,5103, 623 which are shocking how much C ignores.} 622 C ignores length information given in parameter declarations entirely, when determining a function's type. 623 For example, it accepts this pair of declarations 624 \begin{cfa} 625 void f( int, float[][42] ); $\C{// array of len-42 arrays}$ 626 void f( int n, float[][n] ); $\C{// array of VLAs}$ 627 \end{cfa} 628 as a repeat, without an error about conflicting types for @f@. 629 Yet, entirely different stride calculations would occur in a function body whose parameters were declared in each of the two styles. 624 630 625 631 \begin{figure} … … 668 674 An array parameter declaration can specify the outermost dimension with a dimension value, @[10]@ (which is ignored), an empty dimension list, @[ ]@, or a pointer, @*@, as seen in \VRef[Figure]{f:ArParmEquivDecl}. 669 675 The rationale for rejecting the first invalid row follows shortly, while the second invalid row is nonsense, included to complete the pattern; its syntax hints at what the final row actually achieves. 670 Note, in the leftmost style, the typechecker ignores the actual value even ina dynamic expression.676 Note, in the leftmost style, the typechecker ignores the actual value, even for a dynamic expression. 671 677 \begin{cfa} 672 678 int N;
Note:
See TracChangeset
for help on using the changeset viewer.