add: -Wpedantic build flag and fix code

This commit is contained in:
Tobias Reisinger 2020-04-23 16:59:46 +02:00
parent 11f1a79d6a
commit 5b9f2aa49b
7 changed files with 15 additions and 13 deletions
vendor

10
vendor/confini.c vendored
View file

@ -1959,6 +1959,7 @@ static size_t further_cuts (char * const srcstr, const IniFormat format) {
follow (switch case fallthrough).
*/
__attribute__((fallthrough));
case _LIBCONFINI_VT_:
case _LIBCONFINI_FF_:
@ -2527,6 +2528,7 @@ int strip_ini_cache (
(switch case fallthrough).
*/
__attribute__((fallthrough));
case _LIBCONFINI_SC_INT_MARKER_:
@ -2819,7 +2821,7 @@ int load_ini_file (
}
if (file_size > SIZE_MAX) {
if ((size_t) file_size > SIZE_MAX) {
return CONFINI_EFBIG;
@ -2835,7 +2837,7 @@ int load_ini_file (
rewind(ini_file);
if (fread(cache, 1, (size_t) file_size, ini_file) < file_size) {
if (fread(cache, 1, (size_t) file_size, ini_file) < (size_t) file_size) {
free(cache);
return CONFINI_EIO;
@ -2911,7 +2913,7 @@ int load_ini_path (
}
if (file_size > SIZE_MAX) {
if ((size_t) file_size > SIZE_MAX) {
return CONFINI_EFBIG;
@ -2927,7 +2929,7 @@ int load_ini_path (
rewind(ini_file);
if (fread(cache, 1, (size_t) file_size, ini_file) < file_size) {
if (fread(cache, 1, (size_t) file_size, ini_file) < (size_t) file_size) {
free(cache);
return CONFINI_EIO;