oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [jimc:maph 1/1] lib/test_map_h.c:37:2: error: implicit declaration of function 'BUILD_BUG_STREQ' is invalid in C99
@ 2023-03-21  7:46 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-21  7:46 UTC (permalink / raw)
  To: Jim Cromie; +Cc: oe-kbuild-all

tree:   https://github.com/jimc/linux.git maph
head:   d23ecc1b5bd07a90e9bea919ecf2c1b8e5182593
commit: d23ecc1b5bd07a90e9bea919ecf2c1b8e5182593 [1/1] include/linux/map.h: add new header, test it with test_map_h.c (RFC)
config: x86_64-randconfig-a003 (https://download.01.org/0day-ci/archive/20230321/202303211502.NVdgctdi-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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
        # https://github.com/jimc/linux/commit/d23ecc1b5bd07a90e9bea919ecf2c1b8e5182593
        git remote add jimc https://github.com/jimc/linux.git
        git fetch --no-tags jimc maph
        git checkout d23ecc1b5bd07a90e9bea919ecf2c1b8e5182593
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash lib/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303211502.NVdgctdi-lkp@intel.com/

All errors (new ones prefixed by >>):

   lib/test_map_h.c:25:39: error: expected comma in macro parameter list
     #define BUILD_BUG_STREQ(BUILD_BUG_ON(0))
                                         ^
>> lib/test_map_h.c:37:2: error: implicit declaration of function 'BUILD_BUG_STREQ' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           BUILD_BUG_STREQ(debug_cats, 0, "DRMx_CORE");
           ^
   lib/test_map_h.c:37:18: error: use of undeclared identifier 'debug_cats'; did you mean 'debug_locks'?
           BUILD_BUG_STREQ(debug_cats, 0, "DRMx_CORE");
                           ^~~~~~~~~~
                           debug_locks
   include/linux/debug_locks.h:10:12: note: 'debug_locks' declared here
   extern int debug_locks __read_mostly;
              ^
   lib/test_map_h.c:38:18: error: use of undeclared identifier 'debug_cats'; did you mean 'debug_locks'?
           BUILD_BUG_STREQ(debug_cats, 1, "DRMx_DRIVER");
                           ^~~~~~~~~~
                           debug_locks
   include/linux/debug_locks.h:10:12: note: 'debug_locks' declared here
   extern int debug_locks __read_mostly;
              ^
   lib/test_map_h.c:39:18: error: use of undeclared identifier 'debug_cats'; did you mean 'debug_locks'?
           BUILD_BUG_STREQ(debug_cats, 2, "DRMx_KMS");
                           ^~~~~~~~~~
                           debug_locks
   include/linux/debug_locks.h:10:12: note: 'debug_locks' declared here
   extern int debug_locks __read_mostly;
              ^
   5 errors generated.


vim +/BUILD_BUG_STREQ +37 lib/test_map_h.c

    33	
    34	/* force compile, though its not called */
    35	static void __used MAPH_BUILD_BUG(void)
    36	{
  > 37		BUILD_BUG_STREQ(debug_cats, 0, "DRMx_CORE");
    38		BUILD_BUG_STREQ(debug_cats, 1, "DRMx_DRIVER");
    39		BUILD_BUG_STREQ(debug_cats, 2, "DRMx_KMS");
    40	#ifdef FORCE_FAIL
    41		/* properly breaks compile */
    42		BUILD_BUG_STREQ(debug_cats, 1, "'not-in-map'");
    43	#endif
    44	}
    45	

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

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

only message in thread, other threads:[~2023-03-21  7:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21  7:46 [jimc:maph 1/1] lib/test_map_h.c:37:2: error: implicit declaration of function 'BUILD_BUG_STREQ' is invalid in C99 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).