Using clang (13 && 14 && 15) on FreeBSD 13.1 I am getting the following errors.
xxx/blender/intern/cycles/blender/display_driver.cpp:562:7: error: value of type 'void' is not contextually convertible to 'bool'
if (!DCHECK_NOTNULL(tile.buffer_object.gpu_pixel_buffer)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxx/blender/intern/cycles/blender/display_driver.cpp:616:7: error: value of type 'void' is not contextually convertible to 'bool'
if (!DCHECK_NOTNULL(pix_buf)) {
^~~~~~~~~~~~~~~~~~~~~~~~
xxx/blender/intern/cycles/blender/display_driver.cpp:630:7: error: value of type 'void' is not contextually convertible to 'bool'
if (!DCHECK_NOTNULL(pix_buf)) {
^~~~~~~~~~~~~~~~~~~~~~~~
xxx/blender/intern/cycles/blender/display_driver.cpp:719:7: error: value of type 'void' is not contextually convertible to 'bool'
if (!DCHECK_NOTNULL(texture.gpu_texture)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxx/blender/intern/cycles/blender/display_driver.cpp:887:8: error: value of type 'void' is not contextually convertible to 'bool'
if (!DCHECK_NOTNULL(gpu_upload_sync_) || !DCHECK_NOTNULL(gpu_render_sync_)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxx/blender/intern/cycles/util/log.h:57:38: note: expanded from macro 'DCHECK_NOTNULL'
# define DCHECK_NOTNULL(expression) LOG_SUPPRESS()
^~~~~~~~~~~~~~
xxx/blender/intern/cycles/util/log.h:35:47: note: expanded from macro 'LOG_SUPPRESS'
# define LOG_SUPPRESS() (true) ? ((void)0) : LogMessageVoidify() & StubStream()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxx/blender/intern/cycles/blender/display_driver.cpp:887:41: error: invalid operands to binary expression ('void' and 'bool')
if (!DCHECK_NOTNULL(gpu_upload_sync_) || !DCHECK_NOTNULL(gpu_render_sync_)) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi. I am getting the same errors while building latest blender 3.5 with gcc. Older versions builds successfully. The only way I found to get rid of this error, is to enable -DWITH_CYCLES_LOGGING=ON when configuring blender.
This error comes from the DCHECK_NOTNULL macro. This macro along with a variety of other macros in log.h always resolves to ((void)0) and they never do any checking that the names suggest.
log.h should be reviewed and the macros in there should be redefined to represent the functions that the names suggest.
If the intention is only to fill in stubs to allow compiling when logging is disabled, then a more compatible option would be to always equate to true as these would be used in if statements.