Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix warnings/errors on GCC 7/8 (-Wclass-memaccess, -Wsign-conversion, -Wformat-overflow) #1323
Conversation
GCC 8 (incorrectly) warns about sign conversions in (constant)
array size expressions:
error: conversion to 'long unsigned int' from 'int' may
change the sign of the result [-Werror=sign-conversion]
char schemaBuffer_[128 * 1024];
Make these expressions unsigned by adding a 'u' suffix to
the first operands.
GCC 7 and later warn about overflow/truncation when using sprintf and related functions with fixed-size buffers. Suppress the warning in schematest.cpp.
|
Thanks again. |
Recent GCC versions warn about using
memcpy/memmoveto write to a class pointer (-Wclass-memaccess). This has been reported multiple times now, but the suppressions in the master branch are not complete.This PR avoids the warnings by casting the destination pointer to
void*first.Closes #1086.
Closes #1205.
Closes #1246.
Additional warnings are fixed / suppressed as discovered during testing:
-Wsign-conversionwarnings/errors (a26267d)-Wformat-overflowwarning/error (1525116)