intel: Fixes compile error of aubinator_viewer.cpp with gcc
authorYonggang Luo <luoyonggang@gmail.com>
Sun, 7 Aug 2022 12:47:48 +0000 (20:47 +0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 12 Aug 2022 18:06:36 +0000 (18:06 +0000)
Remove '-Wno-class-memaccess' from cpp_args because clang don't support this option

aubinator_viewer.cpp:1183:39: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct Context'; use assignment or value-initialization instead [-Werror=class-memaccess]
 1183 |    memset(&context, 0, sizeof(context));

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18024>

src/intel/tools/aubinator_viewer.cpp
src/intel/tools/meson.build

index ec03238..022f4b8 100644 (file)
@@ -1180,7 +1180,7 @@ int main(int argc, char *argv[])
       { NULL,            0,                 NULL,                          0 }
    };
 
-   memset(&context, 0, sizeof(context));
+   context = {};
 
    i = 0;
    while ((c = getopt_long(argc, argv, "x:s:", aubinator_opts, &i)) != -1) {
index 0a968e9..207e44b 100644 (file)
@@ -156,7 +156,7 @@ if with_tools.contains('intel-ui')
     link_with : [libintel_common, libintel_compiler, libintel_dev, libaub],
     c_args : [no_override_init_args],
     gnu_symbol_visibility : 'hidden',
-    cpp_args : ['-fpermissive', '-Wno-parentheses', '-Wno-class-memaccess'],
+    cpp_args : ['-fpermissive', '-Wno-parentheses'],
     install : true
   )
 endif