Defect Report #237

Previous Defect Report < - > Next Defect Report

Submitter: WG14 Convener (J. Benito)
Submission Date:2001-04-25
Reference Document: N/A
Version: 1.2
Date: 2003-10-23 00:12:00
Subject: Declarations using [static]

Summary Given the following declarations:

  void f(int n, int x[static n]);
   void f(int n, int x[n]) {}
An example at the end of (p21) indicates that these declarations are compatible, but it seems like there should also be something about this in composite types.
  1. If some declarations include "static" and some don't, what is the effect?
  2. Does static only count if it is on the definition?
  3. Does it count if it is on the declaration visible for a given call?

Committee Discussion

The Committee discussed adding a footnote to paragraph 7 along the lines of item 1.

Committee Response

The Committee believe the specification about composite types is clear enough; the composite type will be based on "qualified pointer to type", and the static keyword (and any size values) are not used.

  1. The effect is as if all of the declarations had used static and the largest size value used by any of them. Each declaration imposes requirements on all calls to the function in the program; the only way to meet all of these requirements is to always provide pointers to as many objects as the largest such value requires.
  2. No.
  3. Yes. Visibility is not relevant.

Previous Defect Report < - > Next Defect Report