瀏覽代碼

test: quieten some gcc warnings

Fix some gcc warnings while compiling the testsuite.
Waldemar Brodkorb 8 年之前
父節點
當前提交
d80e49d7b6
共有 5 個文件被更改,包括 7 次插入19 次删除
  1. 1 1
      test/dlopen/tst-origin.c
  2. 4 4
      test/locale-mbwc/dat_mbtowc.c
  3. 1 3
      test/locale-mbwc/tst_funcs.h
  4. 1 8
      test/locale-mbwc/tst_mbrtowc.c
  5. 0 3
      test/test-skeleton.c

+ 1 - 1
test/dlopen/tst-origin.c

@@ -9,7 +9,7 @@ extern void _dlinfo(void);
 
 int main(int argc, char **argv) {
 	void *h1, *h2;
-	int (*mydltest)(const char *s);
+	int __attribute__((unused))(*mydltest)(const char *s);
 	char *error;
 
 	h1 = dlopen ("libtest31.so", RTLD_LAZY);

+ 4 - 4
test/locale-mbwc/dat_mbtowc.c

@@ -135,7 +135,7 @@ TST_MBTOWC tst_mbtowc_loc [] = {
 	  {
 	    { 0, 1, "\xfc\xe4\xf6",	MB_LEN_MAX },
 	    { 0, 1, "\177",	   	MB_LEN_MAX },
-	    { 0, 0, (char)NULL, 	MB_LEN_MAX },
+	    { 0, 0, NULL, 	MB_LEN_MAX },
 	  }
 	},
 	{
@@ -221,7 +221,7 @@ TST_MBTOWC tst_mbtowc_loc [] = {
 	  {
 	    { 0, 1, "ABC",	    MB_LEN_MAX },
 	    { 0, 1, "\177",	    MB_LEN_MAX },
-	    { 0, 0, (char)NULL, MB_LEN_MAX },
+	    { 0, 0, NULL,           MB_LEN_MAX },
 	  }
 	},
 	{
@@ -322,7 +322,7 @@ TST_MBTOWC tst_mbtowc_loc [] = {
 	  {
 	    { 0, 1, "\244\242A",      MB_LEN_MAX },
 	    { 0, 1, "\177\244\242",   MB_LEN_MAX },
-	    { 0, 0, (char)NULL, MB_LEN_MAX },
+	    { 0, 0, NULL,             MB_LEN_MAX },
 	  }
 	},
 	{
@@ -423,7 +423,7 @@ TST_MBTOWC tst_mbtowc_loc [] = {
 	  {
 	    { 0, 1, "\343\201\202A",      MB_LEN_MAX },
 	    { 0, 1, "\177\343\201\202",   MB_LEN_MAX },
-	    { 0, 0, (char)NULL, MB_LEN_MAX },
+	    { 0, 0, NULL,                 MB_LEN_MAX },
 	  }
 	},
 	{

+ 1 - 3
test/locale-mbwc/tst_funcs.h

@@ -84,7 +84,7 @@ extern int result (FILE * fp, char res, const char *func, const char *loc,
 #define TST_DECL_VARS(_type_)				\
 	int   loc, rec, err_count = 0;			\
 	int   warn_count __attribute__ ((unused));	\
-	int   func_id, seq_num = 0;			\
+	int   seq_num = 0;				\
 	const char *locale;				\
 	int   err_exp, ret_flg;				\
 	int errno_save = 0;				\
@@ -97,7 +97,6 @@ extern int result (FILE * fp, char res, const char *func, const char *loc,
 
 #ifdef __UCLIBC_HAS_LOCALE__
 #define TST_HEAD_LOCALE(ofunc, s_func) \
-  func_id = TST_HEAD (ofunc).func_id;					      \
   locale  = TST_HEAD (ofunc).locale;					      \
   if (setlocale (LC_ALL, locale) == NULL)				      \
     {									      \
@@ -109,7 +108,6 @@ extern int result (FILE * fp, char res, const char *func, const char *loc,
     }
 #else
 #define TST_HEAD_LOCALE(ofunc, s_func)					\
-  func_id = TST_HEAD (ofunc).func_id;					\
   locale  = TST_HEAD (ofunc).locale;					\
   if (strcmp(locale, "C") == 0)					\
 	{								\

+ 1 - 8
test/locale-mbwc/tst_mbrtowc.c

@@ -16,7 +16,7 @@ tst_mbrtowc (FILE * fp, int debug_flg)
   char w_flg, s_flg;
   char *s;
   size_t n;
-  char t_flg, t_ini;
+  char t_flg;
   static mbstate_t t = { 0 };
   mbstate_t *pt;
   wchar_t wc, *pwc, wc_ex;
@@ -42,7 +42,6 @@ tst_mbrtowc (FILE * fp, int debug_flg)
 	s = TST_INPUT_SEQ (mbrtowc).s;
 	n = TST_INPUT_SEQ (mbrtowc).n;
 	t_flg = TST_INPUT_SEQ (mbrtowc).t_flg;
-	t_ini = TST_INPUT_SEQ (mbrtowc).t_init;
 	pwc = (w_flg == 0) ? NULL : &wc;
 
 	if (s_flg == 0)
@@ -56,12 +55,6 @@ tst_mbrtowc (FILE * fp, int debug_flg)
 	  }
 
 	pt = (t_flg == 0) ? NULL : &t;
-#if 0
-	if (t_ini != 0)
-	  {
-	    memset (&t, 0, sizeof (t));
-	  }
-#endif
 	TST_CLEAR_ERRNO;
 	ret = mbrtowc (pwc, s, n, pt);
 	TST_SAVE_ERRNO;

+ 0 - 3
test/test-skeleton.c

@@ -325,9 +325,6 @@ main (int argc, char *argv[])
   if (pid == 0)
     {
       /* This is the child.  */
-#ifdef RLIMIT_DATA
-      struct rlimit data_limit;
-#endif
 #ifdef RLIMIT_CORE
       /* Try to avoid dumping core.  */
       struct rlimit core_limit;