]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: stop pacifying Parfait
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Jul 2023 18:31:40 +0000 (11:31 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Jul 2023 18:51:16 +0000 (11:51 -0700)
* src/fmt.c (get_paragraph):
* src/stty.c (display_changed, display_all): Omit calls to
‘assume’ that are present only to pacify false positives by Parfait
<https://labs.oracle.com/pls/apex/f?p=94065:12:17236785746387:13>,
which went in-house in 2012 and never came back.

src/fmt.c
src/stty.c

index cfb4bcf7d5417acc4d1e6da1e898ed3cf8bccb57..ad7a9ce56a00d13bc87e7810b5c68cdf35dd973d 100644 (file)
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -616,10 +616,6 @@ get_paragraph (FILE *f)
         c = get_line (f, c);
     }
 
-  /* Tell static analysis tools that using word_limit[-1] is ok.
-     word_limit is guaranteed to have been incremented by get_line.  */
-  assume (word < word_limit);
-
   (word_limit - 1)->period = (word_limit - 1)->final = true;
   next_char = c;
   return true;
index 37f9b14ffc4b37bb8ff86b9d27b58d1fbdc8dbe0..01de92f8892fcd61131342968d69f4fc8b3078c5 100644 (file)
@@ -1979,12 +1979,6 @@ display_changed (struct termios *mode)
 
       bitsp = mode_type_flag (mode_info[i].type, mode);
       mask = mode_info[i].mask ? mode_info[i].mask : mode_info[i].bits;
-
-      /* bitsp would be null only for "combination" modes, yet those
-         are filtered out above via the OMIT flag.  Tell static analysis
-         tools that it's ok to dereference bitsp here.  */
-      assume (bitsp);
-
       if ((*bitsp & mask) == mode_info[i].bits)
         {
           if (mode_info[i].flags & SANE_UNSET)
@@ -2067,7 +2061,6 @@ display_all (struct termios *mode, char const *device_name)
 
       bitsp = mode_type_flag (mode_info[i].type, mode);
       mask = mode_info[i].mask ? mode_info[i].mask : mode_info[i].bits;
-      assume (bitsp); /* See the identical assertion and comment above.  */
       if ((*bitsp & mask) == mode_info[i].bits)
         wrapf ("%s", mode_info[i].name);
       else if (mode_info[i].flags & REV)