mapbox / variant

C++11/C++14 Variant
BSD 3-Clause "New" or "Revised" License
371 stars 100 forks source link

Add explicit initialization of data to mute clang static analyzer warnings #171

Closed julianrex closed 5 years ago

julianrex commented 5 years ago

This PR adds data initializers wrapped in #ifdef __clang_analyzer__ to mute static analysis warnings from Xcode (10.2).

This will significantly reduce the number of analysis warnings in mapbox-gl-native for iOS/macOS (see https://github.com/mapbox/mapbox-gl-native/issues/7668#issuecomment-482767630).

/cc @tmpsantos @kkaefer

springmeyer commented 5 years ago

@artemp would there be any problem with doing data_type data {}; for all compilers/in all cases and not just when building with the clang analyzer?