linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 2792/2969] lib/test_string.c:188:30: error: initializer element is not a compile-time constant
@ 2022-02-01 10:31 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-02-01 10:31 UTC (permalink / raw)
  To: Kees Cook; +Cc: llvm, kbuild-all, Linux Memory Management List

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   887a333c44eb67973622e530e43cd5e4cf9af927
commit: 05a5ff1e0c9581e4ceb8cdc2cbcce5ed0e9fa2b7 [2792/2969] lib/test_string.c: Add test for strlen()
config: mips-randconfig-r025-20220130 (https://download.01.org/0day-ci/archive/20220201/202202011846.EbcxQdke-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6b1e844b69f15bb7dffaf9365cd2b355d2eb7579)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=05a5ff1e0c9581e4ceb8cdc2cbcce5ed0e9fa2b7
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 05a5ff1e0c9581e4ceb8cdc2cbcce5ed0e9fa2b7
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash lib/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> lib/test_string.c:188:30: error: initializer element is not a compile-time constant
   static const int strlen_ce = strlen("tada, a constant expression");
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 error generated.


vim +188 lib/test_string.c

   181	
   182	/*
   183	 * Unlike many other string functions, strlen() can be used in
   184	 * static initializers when string lengths are known at compile
   185	 * time. (i.e. Under these conditions, strlen() is a constant
   186	 * expression.) Make sure it can be used this way.
   187	 */
 > 188	static const int strlen_ce = strlen("tada, a constant expression");
   189	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


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

only message in thread, other threads:[~2022-02-01 10:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-01 10:31 [linux-next:master 2792/2969] lib/test_string.c:188:30: error: initializer element is not a compile-time constant 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).