oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [kees:devel/overflow/ubsan-only 3/6] lib/test_ubsan.c:61:17: warning: variable 'top' set but not used
@ 2024-01-30 20:33 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-01-30 20:33 UTC (permalink / raw)
  To: Kees Cook; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git devel/overflow/ubsan-only
head:   ec27d9baa678ce3b875e5784ba6ebbf759daabd6
commit: f6f0addd75d22b67b88a390c6f900e83f138ba3e [3/6] ubsan: Introduce CONFIG_UBSAN_POINTER_WRAP
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240131/202401310423.XpCIk6KO-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240131/202401310423.XpCIk6KO-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401310423.XpCIk6KO-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> lib/test_ubsan.c:61:17: warning: variable 'top' set but not used [-Wunused-but-set-variable]
      61 |         volatile void *top = (void *)ULONG_MAX;
         |                        ^
>> lib/test_ubsan.c:69:17: warning: variable 'bottom' set but not used [-Wunused-but-set-variable]
      69 |         volatile void *bottom = (void *)1;
         |                        ^
>> lib/test_ubsan.c:82:28: warning: variable 'half' set but not used [-Wunused-but-set-variable]
      82 |         volatile struct ptr_wrap *half = (void *)(ULONG_MAX - 128);
         |                                   ^
   lib/test_ubsan.c:101:6: warning: variable 'val1' set but not used [-Wunused-but-set-variable]
     101 |         int val1 = 10;
         |             ^
   lib/test_ubsan.c:102:6: warning: variable 'val2' set but not used [-Wunused-but-set-variable]
     102 |         int val2 = INT_MAX;
         |             ^
   lib/test_ubsan.c:136:19: warning: variable 'ptr' set but not used [-Wunused-but-set-variable]
     136 |         bool val, val2, *ptr;
         |                          ^
   lib/test_ubsan.c:137:37: warning: variable 'eptr' set but not used [-Wunused-but-set-variable]
     137 |         enum ubsan_test_enum eval, eval2, *eptr;
         |                                            ^
   lib/test_ubsan.c:182:28: warning: unused variable 'skip_ubsan_array' [-Wunused-const-variable]
     182 | static const test_ubsan_fp skip_ubsan_array[] = {
         |                            ^~~~~~~~~~~~~~~~
   8 warnings generated.


vim +/top +61 lib/test_ubsan.c

    58	
    59	static void test_ubsan_pointer_overflow_add(void)
    60	{
  > 61		volatile void *top = (void *)ULONG_MAX;
    62	
    63		UBSAN_TEST(CONFIG_UBSAN_POINTER_WRAP);
    64		top += 2;
    65	}
    66	
    67	static void test_ubsan_pointer_overflow_sub(void)
    68	{
  > 69		volatile void *bottom = (void *)1;
    70	
    71		UBSAN_TEST(CONFIG_UBSAN_POINTER_WRAP);
    72		bottom -= 3;
    73	}
    74	
    75	struct ptr_wrap {
    76		int a;
    77		int b;
    78	};
    79	
    80	static void test_ubsan_pointer_overflow_mul(void)
    81	{
  > 82		volatile struct ptr_wrap *half = (void *)(ULONG_MAX - 128);
    83		volatile int bump = 128;
    84	
    85		UBSAN_TEST(CONFIG_UBSAN_POINTER_WRAP);
    86		half += bump;
    87	}
    88	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-30 20:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-30 20:33 [kees:devel/overflow/ubsan-only 3/6] lib/test_ubsan.c:61:17: warning: variable 'top' set but not used kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).