This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] rpcgen portability fix


sizeof(char) is always 1. However, CHAR_BIT isn't necessarily 8.
FWIW...

diff -u -r1.28 rpc_main.c
--- rpc_main.c	20 Mar 2006 16:58:13 -0000	1.28
+++ rpc_main.c	12 Jan 2008 05:40:50 -0000
@@ -908,7 +908,7 @@
 	int     i;
 	int     j;
 	int     c;
-	char    flag[(1 << 8 * sizeof(char))];
+	char    flag[1 << CHAR_BIT];
 	int     nflags;
 
 	cmdname = argv[0];


-- 
   - David A. Holland / dholland@eecs.harvard.edu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]