Questions tagged [c11]

C11 refers to the ANSI C language standard finalized in 2011.

C11 (formerly C1X) is an informal name for ISO/IEC 9899:2011. For more details see wikipedia.

4 questions
17
votes
2 answers

Why were variable length arrays made optional in C 2011?

When VLAs were introduced in C 1999, I thought it was a great innovation to the language. However, having learned it was made optional in C 2011, I am wondering what led to its change in status, and if it means the feature is actually headed for…
jxh
  • 479
  • 3
  • 10
0
votes
1 answer

Why are zero length VLAs allowed in C99, but not in C11 any more?

In the comments to this former question, there was a discussion if the C standard allows variable length arrays (VLAs) of length 0 or not. As it turns out, the C99 standard states: In 6.7.5.2 Array declarators, Constraints: "If the expression [for…
Doc Brown
  • 199,015
  • 33
  • 367
  • 565
0
votes
2 answers

Is it acceptable to use C11 generic macros in Objective-C to box numbers?

I was getting tired of repeating types when writing things like this: NSDictionary* d = @{@"so": [NSNumber numberWithInt:index]), @"much": [NSNumber numberWithBool:accepted]), @"repeat": [NSNumber…
Craig Gidney
  • 831
  • 7
  • 16
-3
votes
1 answer

Could ANSI C standardized linkage syntax from early C wrong?

Recently I came up to something illogical, reading the latest ANSI C paper. It was talking about linkage but it never mentioned a way to declare internal identifiers inside block-scope (or at least in a useful way). Imagine something like this: int…
FISOCPP
  • 147
  • 8