Re: [PATCH 1/6] bitrotate: prefer C2y to bitrotate or by-hand

Bruno Haible via Gnulib discussion list <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs
Message-ID <9184366.EvYhyI6sBW@cagnes>
Paul Eggert wrote:
> Deprecate the bitrotate module; it is superseded by C2y’s
> stdc_rotate_left and stdc_rotate_right.  In several places, prefer
> the C2y functions to doing things by hand.

After removing the uses of macro CHAR_BIT, '#include <limits.h>' is
no longer needed in some files.


2026-07-12  Bruno Haible  <[email protected]>

	Remove unnecessary include after 2026-06-26 change.
	* lib/struniq.h: Update comment.
	* lib/getlocalename_l-unsafe.c: Don't include <limits.h>.
	* lib/getlocalename_l.c: Likewise.
	* lib/hashcode-mem.c: Likewise.
	* lib/hashcode-string2.c: Likewise.
	* lib/hashkey-string.c: Likewise.
	* lib/localename.c: Likewise.
	* lib/mem-hash-map.c: Likewise.
	* tests/test-array_map.c: Likewise.
	* tests/test-avltreehash_list.c: Likewise.
	* tests/test-hash_map.c: Likewise.
	* tests/test-linkedhash_list.c: Likewise.
	* tests/test-linkedhash_map.c: Likewise.
	* tests/test-rbtreehash_list.c: Likewise.

diff --git a/lib/getlocalename_l-unsafe.c b/lib/getlocalename_l-unsafe.c
index bd24a8de7a..1d674f219b 100644
--- a/lib/getlocalename_l-unsafe.c
+++ b/lib/getlocalename_l-unsafe.c
@@ -24,9 +24,8 @@
 #include "getlocalename_l-unsafe.h"
 
 #include <locale.h>
-#include <limits.h>
-#include <stddef.h>
 #include <stdbit.h>
+#include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
 
diff --git a/lib/getlocalename_l.c b/lib/getlocalename_l.c
index fea5ae2269..140916ceb9 100644
--- a/lib/getlocalename_l.c
+++ b/lib/getlocalename_l.c
@@ -19,7 +19,6 @@
 /* Specification.  */
 #include <locale.h>
 
-#include <limits.h>
 #include <stdbit.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/hashcode-mem.c b/lib/hashcode-mem.c
index 30ee835107..c0746f053d 100644
--- a/lib/hashcode-mem.c
+++ b/lib/hashcode-mem.c
@@ -20,7 +20,6 @@
 /* Specification.  */
 #include "hashcode-mem.h"
 
-#include <limits.h>
 #include <stdbit.h>
 
 /* Return a hash of the N bytes of X using the method described by
diff --git a/lib/hashcode-string2.c b/lib/hashcode-string2.c
index 3009d1489c..35c28638a5 100644
--- a/lib/hashcode-string2.c
+++ b/lib/hashcode-string2.c
@@ -20,7 +20,6 @@
 /* Specification.  */
 #include "hashcode-string2.h"
 
-#include <limits.h>
 #include <stdbit.h>
 
 /* A hash function for NUL-terminated char* strings using
diff --git a/lib/hashkey-string.c b/lib/hashkey-string.c
index abd1956eba..b0c751c31d 100644
--- a/lib/hashkey-string.c
+++ b/lib/hashkey-string.c
@@ -19,7 +19,6 @@
 /* Specification.  */
 #include "hashkey-string.h"
 
-#include <limits.h>
 #include <stdbit.h>
 #include <string.h>
 
diff --git a/lib/localename.c b/lib/localename.c
index 3cf4be26d1..aac0f7ce90 100644
--- a/lib/localename.c
+++ b/lib/localename.c
@@ -25,7 +25,6 @@
 /* Specification.  */
 #include "localename.h"
 
-#include <limits.h>
 #include <stdbit.h>
 #include <stdlib.h>
 #include <locale.h>
diff --git a/lib/mem-hash-map.c b/lib/mem-hash-map.c
index c8620ee22d..fdb4f0be00 100644
--- a/lib/mem-hash-map.c
+++ b/lib/mem-hash-map.c
@@ -24,7 +24,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <limits.h>
 #include <sys/types.h>
 
 #include "next-prime.h"
diff --git a/lib/struniq.h b/lib/struniq.h
index afa616c864..cad21ad942 100644
--- a/lib/struniq.h
+++ b/lib/struniq.h
@@ -19,7 +19,6 @@
 
 /* This file needs the following includes:
 
-     #include <limits.h>
      #include <stdbit.h>
      #include <stdlib.h>
      #include <string.h>
diff --git a/tests/test-array_map.c b/tests/test-array_map.c
index 9d84d45a1c..5e93d4b74c 100644
--- a/tests/test-array_map.c
+++ b/tests/test-array_map.c
@@ -19,7 +19,6 @@
 
 #include "gl_array_map.h"
 
-#include <limits.h>
 #include <stdbit.h>
 #include <stdcountof.h>
 #include <stdlib.h>
diff --git a/tests/test-avltreehash_list.c b/tests/test-avltreehash_list.c
index d31cd1f718..1ed6844287 100644
--- a/tests/test-avltreehash_list.c
+++ b/tests/test-avltreehash_list.c
@@ -19,7 +19,6 @@
 
 #include "gl_avltreehash_list.h"
 
-#include <limits.h>
 #include <stdbit.h>
 #include <stdcountof.h>
 #include <stdlib.h>
diff --git a/tests/test-hash_map.c b/tests/test-hash_map.c
index b9d02f3568..c9c7dfcd25 100644
--- a/tests/test-hash_map.c
+++ b/tests/test-hash_map.c
@@ -19,7 +19,6 @@
 
 #include "gl_hash_map.h"
 
-#include <limits.h>
 #include <stdbit.h>
 #include <stdcountof.h>
 #include <stdlib.h>
diff --git a/tests/test-linkedhash_list.c b/tests/test-linkedhash_list.c
index f8281f7bef..d749cac6b6 100644
--- a/tests/test-linkedhash_list.c
+++ b/tests/test-linkedhash_list.c
@@ -19,7 +19,6 @@
 
 #include "gl_linkedhash_list.h"
 
-#include <limits.h>
 #include <stdbit.h>
 #include <stdcountof.h>
 #include <stdlib.h>
diff --git a/tests/test-linkedhash_map.c b/tests/test-linkedhash_map.c
index 22011e18af..24cd3c7fb8 100644
--- a/tests/test-linkedhash_map.c
+++ b/tests/test-linkedhash_map.c
@@ -19,7 +19,6 @@
 
 #include "gl_linkedhash_map.h"
 
-#include <limits.h>
 #include <stdbit.h>
 #include <stdcountof.h>
 #include <stdlib.h>
diff --git a/tests/test-rbtreehash_list.c b/tests/test-rbtreehash_list.c
index 7709bf96e9..c3b2346bfc 100644
--- a/tests/test-rbtreehash_list.c
+++ b/tests/test-rbtreehash_list.c
@@ -19,7 +19,6 @@
 
 #include "gl_rbtreehash_list.h"
 
-#include <limits.h>
 #include <stdbit.h>
 #include <stdcountof.h>
 #include <stdlib.h>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.