[linux-next:master 6378/6705] mseal_test.c:84:59: warning: format specifies type 'char *' but the argument has type 'char (*)[5]'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7b4f2bc91c15fdcf948bb2d9741a9d7d54303f8d
commit: 87c436bebeeb885b21f47a7dbcfc548e9679c688 [6378/6705] selftest mm/mseal memory sealing
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/20240419/202404190226.OfJOewV8-lkp@xxxxxxxxx/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 <yujie.liu@xxxxxxxxx>
| Closes: https://lore.kernel.org/r/202404190226.OfJOewV8-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> mseal_test.c:84:59: warning: format specifies type 'char *' but the argument has type 'char (*)[5]' [-Wformat]
      84 |                 if (sscanf(line, "%lx-%lx %4s", &addr_start, &addr_end, &protstr) == 3) {
         |                                           ~~~                           ^~~~~~~~
   1 warning generated.


vim +84 tools/testing/selftests/mm/mseal_test.c

87c436bebeeb88 Jeff Xu 2024-04-15   69  
87c436bebeeb88 Jeff Xu 2024-04-15   70  static unsigned long get_vma_size(void *addr, int *prot)
87c436bebeeb88 Jeff Xu 2024-04-15   71  {
87c436bebeeb88 Jeff Xu 2024-04-15   72  	FILE *maps;
87c436bebeeb88 Jeff Xu 2024-04-15   73  	char line[256];
87c436bebeeb88 Jeff Xu 2024-04-15   74  	int size = 0;
87c436bebeeb88 Jeff Xu 2024-04-15   75  	uintptr_t  addr_start, addr_end;
87c436bebeeb88 Jeff Xu 2024-04-15   76  	char protstr[5];
87c436bebeeb88 Jeff Xu 2024-04-15   77  	*prot = 0;
87c436bebeeb88 Jeff Xu 2024-04-15   78  
87c436bebeeb88 Jeff Xu 2024-04-15   79  	maps = fopen("/proc/self/maps", "r");
87c436bebeeb88 Jeff Xu 2024-04-15   80  	if (!maps)
87c436bebeeb88 Jeff Xu 2024-04-15   81  		return 0;
87c436bebeeb88 Jeff Xu 2024-04-15   82  
87c436bebeeb88 Jeff Xu 2024-04-15   83  	while (fgets(line, sizeof(line), maps)) {
87c436bebeeb88 Jeff Xu 2024-04-15  @84  		if (sscanf(line, "%lx-%lx %4s", &addr_start, &addr_end, &protstr) == 3) {
87c436bebeeb88 Jeff Xu 2024-04-15   85  			if (addr_start == (uintptr_t) addr) {
87c436bebeeb88 Jeff Xu 2024-04-15   86  				size = addr_end - addr_start;
87c436bebeeb88 Jeff Xu 2024-04-15   87  				if (protstr[0] == 'r')
87c436bebeeb88 Jeff Xu 2024-04-15   88  					*prot |= 0x4;
87c436bebeeb88 Jeff Xu 2024-04-15   89  				if (protstr[1] == 'w')
87c436bebeeb88 Jeff Xu 2024-04-15   90  					*prot |= 0x2;
87c436bebeeb88 Jeff Xu 2024-04-15   91  				if (protstr[2] == 'x')
87c436bebeeb88 Jeff Xu 2024-04-15   92  					*prot |= 0x1;
87c436bebeeb88 Jeff Xu 2024-04-15   93  				break;
87c436bebeeb88 Jeff Xu 2024-04-15   94  			}
87c436bebeeb88 Jeff Xu 2024-04-15   95  		}
87c436bebeeb88 Jeff Xu 2024-04-15   96  	}
87c436bebeeb88 Jeff Xu 2024-04-15   97  	fclose(maps);
87c436bebeeb88 Jeff Xu 2024-04-15   98  	return size;
87c436bebeeb88 Jeff Xu 2024-04-15   99  }
87c436bebeeb88 Jeff Xu 2024-04-15  100  

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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux