Skip to content

Use modern C and modern compiler features [v9.16]

Ondřej Surý requested to merge ondrej/use-newer-compiler-features-v9_16 into v9_16

This MR consists of several commits that introduce modern C or modern compiler features (with fallbacks):

  • Gcc 7+/Clang 10+ have __attribute__((__fallthrough__)), use that as FALLTHROUGH; macro
  • Use __builtin_unreachable() for ISC_UNREACHABLE(); macro and merge INSIST(0); ISC_UNREACHABLE(); just to UNREACHABLE();
  • Use C11 noreturn with fallback to __attribute__((__noreturn__)) (NOTE: This has been dropped because of WIN32 __declspec(noreturn)
  • Remove use of the inline keyword used as a suggestion to the compiler
  • Remove workarounds for ancient versions of clang (<< 4.0.1)

Backport of !5480 (merged)

Edited by Michał Kępień

Merge request reports