This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] assert: Support types without operator== (int) [BZ #21972]
Florian Weimer wrote:
I think it's still valuable to use static_cast<bool> (expr) for C++
because we don't need any extensions (except __FUNCTION__ for early C++)
because the parentheses do not count in this context; assert (a = 1)
still results in a warning.
OK, but in that case the C version shouldn't use 'sizeof ((expr) ? 1 : 0)'
either, right? As that would suppress the warning in the C case. So it sounds
like your original patch was right after all (and sorry about the noise...).