Suppress GCC 12.1.1 warnings.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 8 Jul 2022 17:51:23 +0000 (10:51 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 8 Jul 2022 17:51:23 +0000 (10:51 -0700)
I don't think these warnings are for real problems, so just suppress them.

I don't understand why the change to datasheet-test.c suppresses a warning,
but it does.

Makefile.am
tests/data/datasheet-test.c
tests/language/lexer/segment-test.c

index 4dfc50c8ec6bfce3edf395d83e815ffe5431129d..6693874f580c6d475303c72e87874d8c60807791 100644 (file)
@@ -75,7 +75,7 @@ generate-changelog:
 
 DIST_HOOKS += generate-changelog
 
-GL_CFLAG_GNULIB_WARNINGS = -Wno-missing-prototypes -Wno-unused-parameter
+GL_CFLAG_GNULIB_WARNINGS = -Wno-missing-prototypes -Wno-unused-parameter -Wno-alloc-size-larger-than
 
 include $(top_srcdir)/build-aux/automake.mk
 include $(top_srcdir)/gl/automake.mk
index f0384853e60ccde412a3633f08ca40dd0a698b9a..5ad31b2db89a46f8675b904288a4de091b23dd41 100644 (file)
@@ -699,7 +699,7 @@ datasheet_mc_mutate (struct mc *mc, const void *ods_)
 
           datasheet_delete_rows (ds, pos, n);
 
-          release_data (n, oproto, &data[pos]);
+          release_data (n, oproto, data + pos);
           remove_range (&data[0], n_rows, sizeof data[0], pos, n);
 
           check_datasheet (mc, ds, data, n_rows - n, oproto);
index acb444f20018c3dceb87da7a106592be21acaed9..5977e8fce69236c868d4035f14515350d385afaf 100644 (file)
@@ -155,6 +155,7 @@ check_segmentation (const char *input, size_t length, bool print_segments)
                    offset);
         }
       assert (offset + n <= length);
+      assert (offset <= length);
 
       if (type == SEG_NEWLINE)
         {