On 14/06/16 10:32, Florian Weimer wrote:
A long time ago, GCC decided that warn_unused_result warnings should
*not* be silenced by casting to void, as in:
(void) write (STDOUT_FILENO, message, strlen (message));
Apparently, programmers have figured out to use this idiom as a replacement:
The attached shell script will generate a larger version
of the following:
constexpr bool static_str_equal(const char* x, const char* y) {
return (*x == 0 || *y == 0) ?
(*x == *y) :
((*x == *y) && static_str_equal(x + 1, y + 1));
}
int main(void)
{
static_assert( !static_str_equal("uns
While trying to compile coreutils with -Wextra,
I noticed many warnings due to automatic variables
initialized with { 0, }.
As I understand it, since C90 the above will initialize
[all members of] the type to that used in static scope.
I.E. the following is valid:
mbstate_t m = { 0, };
int i = {