Skip to content

Latest commit

 

History

History
115 lines (97 loc) · 12.7 KB

C18.md

File metadata and controls

115 lines (97 loc) · 12.7 KB

Status of C18 support

C18 (also called C17) does not add any new features to C11, but it does incorporate changes and clarifications suggested in the following Defect Reports (DRs). For details, see:

Below we outline whether a change was required to our semantics of C11 to incorporate the wording of a DR and what changes those were in each case.

DR # Summary Change required? Notes
400 realloc with size zero problems Yes 5
401 "happens before" cannot be cyclic No 2
402 memory model coherence is not aligned with C++11 No 2
403 malloc() and free() in the memory model No 2
404 joke fragment remains in a footnote No 3
405 mutex specification not aligned with C++11 on total order No 2
406 Visible sequences of side effects are redundant No 2
407 SC fences do not restrict modification order enough No 1
410 ilogb inconsistent with lrint, lround No 1
412 #elif No 4
414 typos in 6.27 threads.h No 3
415 Missing divide by zero entry in Annex J.2 Yes 6
416 Proposed defect report regarding tss_t No 2
417 Missing entries in Annex J Yes 6
419 What the heck is a "generic function"? No 7
423 underspecification for qualified rvalues Yes 8
426 G.5.1: -yv and -x/v are ambiguous No 1 (complex arith.)
428 runtime-constraint issue with sprintf family of routines in Annex K No 1 (bounds checking)
429 Should gets_s discard next input line when (s == NULL) ? No 1 (bounds checking)
430 getenv_s, maxsize should be allowed to be zero No 1 (bounds checking)
431 atomic_compare_exchange: What does it mean to say two structs compare equal? No 2 (atomic)
433 Issue with constraints for wide character function No 1 (bounds checking)
434 Missing constraint w.r.t. Atomic No 9
436 Request for interpretation of C11 6.8.5#6 No 9
437 clock overflow No 1
438 ungetc / ungetwc and file position after discarding push back No 9
439 Issues with the definition of "full expression" TODO sequence points
441 Floating-point issues in C11 from PDTS 18661-1 UK review, Issue 2 No 1
444 Issues with alignment in C11, part 1 Yes 10
445 Issues with alignment in C11, part 2 Yes 10
447 Boolean from complex No 1
448 What are the semantics of a # non-directive? No 1
450 tmpnam_s clears s[0] No 1
452 Effective Type in Loop Invariant Yes 11
453 Atomic flag type and operations No 1
457 The ctime_s function in Annex K defined incorrectly No 1 (bounds checking)
458 ATOMIC_XXX_LOCK_FREE macros not constant expressions No 1
459 atomic_load missing const qualifier No 1
460 aligned_alloc underspecified Yes 12
462 Clarifying objects accessed in signal handlers TODO signals
464 Clarifying the Behavior of the #line Directive No 4
465 Fixing an inconsistency in atomic_is_lock_free No 2 (atomic)
468 strncpy_s clobbers buffer past null No 1 (bounds checking)
470 mtx_trylock should be allowed to fail spuriously No 2 (threads.h)
471 Complex math functions cacosh and ctanh No 1
472 Introduction to complex arithmetic in 7.3.1p3 wrong due to CMPLX No 1 (complex arith.)
473 "A range error occurs if x is too large." is misleading No 1 (math.h)
475 Misleading Atomic library references to atomic types No 2 (stdatomic.h)
477 nan should take a string argument No 1
480 cnd_wait and cnd_timewait should allow spurious wake-ups No 2 (threads.h)
481 Controlling expression of _Generic primary expression Yes 13
485 Problem with the specification of ATOMIC_VAR_INIT No 1
487 timespec vs. tm No 1
491 Concern with Keywords that Match Reserved Identifiers No 9

Notes

  1. No change required: DR concerns a feature or part of the C11 standard which our C11 semantics did not cover, e.g., the preprocessor, much of the standard library, and optional extensions. In the future, if we model this feature with our semantics, we will incorporate this DR.

  2. No change required: We have very limited support for multi-threaded programs and the C/C++11 shared memory consistency model. In the future, when we implement the C/C++11 memory consistency model, we will incorporate this DR.

  3. No change required: DR wording has little or no normative impact (such as a typo fix) and requires no change to our project.

  4. No change required: DR concerns the preprocessor, which is not modeled by our semantics.

  5. Change required: added a check for the implementation-defined behavior resulting from passing a zero size to realloc (as well as malloc, calloc, and aligned_alloc).

  6. Change required: because we reference the items listed in Appendix J (portability issues) by the order in which they appear, we need to update references to this appendix with the new ordinals.

  7. No change required: We have very limited support for stdatomic.h. In the future, when we implement these features, we will incorporate this DR.

  8. Change required: changes were made to our semantics of casting values to qualified types. The type of such expressions is the unqualified type.

  9. No change required: updated wording perhaps has normative impact or resolves some ambiguity, but conforms to our interpretation of the standard.

  10. Change required: semantics of alignment.

  11. Change required: effective type of objects with a temporary lifetime.

  12. Change required: semantics of aligned_alloc were updated to allow unsupported alignments to result in returning a null pointer and no undefined behavior.

  13. Change required: The semantics of calculating the type of the controlling expression in a generic selection were updated.