Content-Type: multipart/mixed; boundary="===============1457090772416937419==" MIME-Version: 1.0 From: Kees Cook To: kbuild-all@lists.01.org Subject: Re: [PATCH] lib/test_string.c: Add test for strlen() Date: Sun, 30 Jan 2022 12:35:13 -0800 Message-ID: <202201301234.D62394C08@keescook> In-Reply-To: <202201310303.HQlCsvvd-lkp@intel.com> List-Id: --===============1457090772416937419== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Mon, Jan 31, 2022 at 04:13:30AM +0800, kernel test robot wrote: > Hi Kees, > = > I love your patch! Yet something to improve: > = > [auto build test ERROR on linux/master] > [also build test ERROR on linus/master kees/for-next/pstore v5.17-rc2 nex= t-20220128] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch] > = > url: https://github.com/0day-ci/linux/commits/Kees-Cook/lib-test_strin= g-c-Add-test-for-strlen/20220131-023726 > base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi= t 2c271fe77d52a0555161926c232cd5bc07178b39 > config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220131= /202201310303.HQlCsvvd-lkp(a)intel.com/config) > compiler: sh4-linux-gcc (GCC) 11.2.0 > reproduce (this is a W=3D1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/0day-ci/linux/commit/d22fe883339c5141953dbca= 980b51466ac3e2329 > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review Kees-Cook/lib-test_string-c-Add-= test-for-strlen/20220131-023726 > git checkout d22fe883339c5141953dbca980b51466ac3e2329 > # save the config file to linux build tree > mkdir build_dir > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cro= ss O=3Dbuild_dir ARCH=3Dsh SHELL=3D/bin/bash M=3Dlib/ > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > = > All errors (new ones prefixed by >>): > = > >> lib/test_string.c:188:30: error: initializer element is not constant > 188 | static const int strlen_ce =3D strlen("tada, a constant expres= sion"); > | ^~~~~~ Thanks; this is expected -- the strlen() in -next is currently broken (and will be fixed in the next -next). -Kees > = > = > 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 =3D strlen("tada, a constant expression= "); > 189 = > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org -- = Kees Cook --===============1457090772416937419==--