Ignore:
Timestamp:
Dec 12, 2025, 12:18:17 PM (4 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master, stuck-waitfor-destruct
Children:
67748f9, 79ba50c
Parents:
f2b74e3
Message:

Edits in early sections.

Includes explicating the connection between unsafety stats and the three collection types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/background.tex

    rf2b74e3 rfe6047c  
    620620In fact, the outermost type constructor (syntactically first dimension) is really the one that determines the parameter flavour.
    621621
    622 \PAB{TODO: add examples of mycode/arrr/bugs/c-dependent/x.cfa:v5102,5103,
    623 which are shocking how much C ignores.}
     622C ignores length information given in parameter declarations entirely, when determining a function's type.
     623For 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}
     628as a repeat, without an error about conflicting types for @f@.
     629Yet, entirely different stride calculations would occur in a function body whose parameters were declared in each of the two styles.
    624630
    625631\begin{figure}
     
    668674An 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}.
    669675The 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 in a dynamic expression.
     676Note, in the leftmost style, the typechecker ignores the actual value, even for a dynamic expression.
    671677\begin{cfa}
    672678int N;
Note: See TracChangeset for help on using the changeset viewer.