]> Savannah Git Hosting - gnulib.git/commitdiff
bcp47: Silence a gcc 14 -Wanalyzer-infinite-loop warning.
authorBruno Haible <bruno@clisp.org>
Thu, 12 Dec 2024 13:07:06 +0000 (14:07 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 12 Dec 2024 13:07:06 +0000 (14:07 +0100)
* lib/bcp47.c: Include <stdlib.h>.
(bcp47_to_xpg): Verify an invariant through an abort().

ChangeLog
lib/bcp47.c

index 8b1b923d176eec892043a18f332c6a3e2c069275..47b518100f8a3d6a13712c4e9d06615791ee88fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-12-12  Bruno Haible  <bruno@clisp.org>
+
+       bcp47: Silence a gcc 14 -Wanalyzer-infinite-loop warning.
+       * lib/bcp47.c: Include <stdlib.h>.
+       (bcp47_to_xpg): Verify an invariant through an abort().
+
 2024-12-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        doc: isdigit and isxdigit are locale-independent
index 96f7aad8cec91e14233eb6d57a20ed398b16c17f..09f60f1eecbf31e1fdbc21fb18f9cb7ee1ac2205 100644 (file)
@@ -21,6 +21,7 @@
 /* Specification.  */
 #include "bcp47.h"
 
+#include <stdlib.h>
 #include <string.h>
 
 #include "c-ctype.h"
@@ -421,6 +422,8 @@ bcp47_to_xpg (char *xpg, const char *bcp47, const char *codeset)
                   }
               }
           }
+        else
+          abort ();
       }
   }