Page MenuHome

Cycles: Get rid of a few unitialized variable warnings
Needs RevisionPublic

Authored by Lukas Stockner (lukasstockner97) on Feb 12 2017, 8:38 PM.

Details

Summary

None of them were actual bugs, the compiler (GCC 5.4.0) just wasn't smart enough to ensure that they're always set before they're used.
There's one remaining at intern/cycles/kernel/kernel_bake.h:317, but explicitly initializing PathRadiance might cause a noticeable slowdown.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 428
Build 428: arc lint + arc unit

Event Timeline

Lukas Stockner (lukasstockner97) retitled this revision from to Cycles: Get rid of a few unitialized variable warnings.
Sergey Sharybin (sergey) requested changes to this revision.Feb 13 2017, 9:28 AM
Sergey Sharybin (sergey) edited edge metadata.

I'm not really fond of such things. It is a compiler idiocy and silencing it will make troubleshooting real bugs more tricky. Such uninitialized variables access will never be catched by valgrind or similar tools.

Doing such things in a kernel is not necesserily a good idea either.

If we do go this route, initialize variables to some invalid value and add an assert() before those variables are used.

This revision now requires changes to proceed.Feb 13 2017, 9:28 AM