intel / intel/media-driver

[Bug]: Project does not compile due to -Werror

Open
#1,450 4 comments 0 reactions 1 assignee Assigned to @hye5 View on GitHub
Build Common P2
Dominant language
C
Stars
1.2k
Forks
383
Avg merge
8d 18h
Merged PRs (30d)
4

Description

### Which component impacted?

Not sure

### Is it regression? Good in old configuration?

_No response_

### What happened?

I frequently have issues compiling the project due to -Werror. It took me a while to find out the configuration to disable it, i.e. `MEDIA_BUILD_FATAL_WARNINGS`, I wonder if this can be added to the README?

Even with this flag turned off, I think the code still won't compile due to -Werror=address, i.e.

```
/home/dwls/dev/media-driver/media_softlet/agnostic/common/codec/hal/codechal_debug.cpp: In member function ‘virtual MOS_STATUS CodechalDebugInterface::DumpRgbDataOnYUVSurface(PMOS_SURFACE, const char*, const char*, MEDIA_DEBUG_STATE_TYPE, uint32_t, uint32_t)’:
/home/dwls/dev/media-driver/media_softlet/agnostic/common/codec/hal/codechal_debug.cpp:705:9: error: the address of ‘MOS_SURFACE::OsResource’ will never be NULL [-Werror=address]
705 | if (&(tmpRgbSurface->OsResource))
```

commit is bbb44225fa58ca0c0e4ff5cbb7337f6412d8603b

I noticed that the Arch Linux packagers have also disabled that flag, possibly because it was also breaking the build for them, i.e.: https://github.com/archlinux/svntogit-community/blob/packages/intel-media-driver/trunk/PKGBUILD

```
build() {
cmake -B build -S ${pkgname#*-}-${pkgname%-*}-${pkgver} \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DINSTALL_DRIVER_SYSCONF=OFF \
-DMEDIA_BUILD_FATAL_WARNINGS=OFF \
-Wno-dev
make -C build
}
```

### What's the usage scenario when you are seeing the problem?

Others

### What impacted?

I usually compile this project as a last resort to try and debug my own code, which uses VA-API to decode video. Recently there was a regression causing a segfault inside `iHD_drv_video.so` so there was no way to know what was wrong without compiling it with debug symbols.

### Debug Information

_No response_

### Do you want to contribute a patch to fix the issue?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.