News for hackers. Stuff that matters.
Re:The Linux codebase has over 3k TODO comments, many from o... by john_moscow on Monday December 30, 2019 @01:01AM (#21911159)
Assert's run-time. This is compile-time (i.e. all instances are guaranteed to trigger during build). C++ equivalent would be a static_assert, but it has a totally different use case like this:

  static_assert(sizeof(StructUsedInSomeBinaryProtocol) == SomeConstantExpectedByTheOtherSide, "<...>")
Re:The Linux codebase has over 3k TODO comments, many from o... by TeMPOraL on Monday December 30, 2019 @02:22AM (#21911460)
We used to do static asserts with a preprocessor macro that typedefed an array with size expressed as: (your condition) ? 1 : -1. Point being, static asserts have the use case you want them to have; I see no reason to not have a TODO macro that expands to static_assert(false, "...").