Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 12.5 - sized and unsized array parameters
#1
Does Rule 12.5 from AMD-1 apply to unsized array parameters (those without a size between the brackets)? E.g.:

Code:
void f(int32_t A[4], int32_t B[]) {
    uint32_t sizeA = sizeof(A);  // Obvious violation of 12.5
    uint32_t sizeB = sizeof(B);  // Violation of 12.5?
}

The snippets in the amplification, rationale, and examples exclusively use sized arrays and the rationale does not seem to apply as strongly to unsized array parameters but the rule does not specify that it only applies to sized arrays or to both sized and unsized arrays. Can you please clarify the intention here?
<t></t>


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)