This would prevent the last bug (!ua()) as the control flow sensitive analysis can reason about both branches: that it is invalid to deref ua within the block. The dynamic check misses the bug because the branch is never taken for the given inputs.
I am fairly confident that the clang-tidy pass is simpler and more precise in most cases than the hand-rolled implementation. (That said the static check may not be able to reason about mutation well.)
If you need to pass an error in the failure case, you can use std::expected (available in C++23). clang-tidy has an open bug about supporting a similar check for std::expected: https://github.com/llvm/llvm-project/issues/135045
if (int x = foo(); x) { ... }
nor the C++98 syntax if (int x = foo()) { ... }
is supported in C99, it still introduces the rule that the entire if statement is a scope (which it wasn’t in C89). So as a party trick, here’s a way to check for C99 without using the preprocessor: int c99() {
enum { C99 = 1 };
{
if (sizeof(enum { C99 = 0 })) { }
return C99;
}
}
I make no promises about the behaviour of this code on insufficiently anal compilers like TCC.https://github.com/ioccc-src/winner/blob/a1c86c8a7a533e3c2cd...
x*=02//* */2
-1;
With C89, this is evaluated as "x *= 02 / 2 - 1", or "x *= 0".With C99, this is evaluated as "x *= 02 / -1", or "x *= -2".
But tcc isn't a C++ compiler at all?
I think.
If you use github release workflow, you don't even have a choice about it. You cannot create a release without creating a matching tag.
Maybe she doesn't, though. At a previous job I logged build IDs and never ended up needing them because we were able to uphold a Git-first process pretty well
You can pass a `git describe` directly to just about any git command that takes a "commitish", so can copy and paste it directly to `git switch` or `git checkout` just as you would with a full hash. Except you also have prefixed human-readable version information that you can update.
About the only complaint with `git describe` is that if you are presenting these version numbers in semver scenarios and want the best semver ordering you want to replace that first "-" with a "+" and the second "-" with a ".", which aligns it better with semver's optional build metadata rather than looking like a semver pre-release.
You may very well be able to ditch colors using this technique with additional characters. Many characters are distinct with their inverted counterpart.