Skip to content
  • Rodrigo Vivi's avatar
    lib/igt_aux.h: Cast is confusing old gcc · d20b870e
    Rodrigo Vivi authored and Chris Wilson's avatar Chris Wilson committed
    
    
    I noticed in some machines igt compilation was breaking
    after igt_dummyload was introduced.
    
    I don't know exactly why, but it seems this cast seems to let
    old gcc a bit confused. Without the cast everything works
    properly.
    
    Compilation Error log:
      CC       igt_dummyload.lo
    In file included from igt.h:30:0,
                     from igt_dummyload.c:25:
    igt_aux.h:288:39: error: initializer element is not constant
     #define __IGT_INIT_LIST(name) (struct igt_list){ &(name), &(name) }
                                           ^
    igt_aux.h:289:47: note: in expansion of macro ‘__IGT_INIT_LIST’
     #define IGT_LIST(name) struct igt_list name = __IGT_INIT_LIST(name);
                                                   ^
    igt_dummyload.c:50:8: note: in expansion of macro ‘IGT_LIST’
     static IGT_LIST(spin_list);
            ^
    make[4]: *** [igt_dummyload.lo] Error 1
    
    Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
    Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    Reviewed-by: default avatarAbdiel Janulgue <abdiel.janulgue@linux.intel.com>
    d20b870e