Skip to content

Commit

Permalink
fix(decompression): suppress maybe uninitialized gcc warning
Browse files Browse the repository at this point in the history
Warning is for looping policy but usage is perfectly safe
  • Loading branch information
nfrechette committed Oct 21, 2023
1 parent c035b73 commit 62566a3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions includes/acl/decompression/impl/decompression.scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ namespace acl
}
}

// We only initialize some variables when we need them which prompts the compiler to complain
// The usage is perfectly safe and because this code is VERY hot and needs to be as fast as possible,
// we disable the warning to avoid zeroing out things we don't need
#if defined(RTM_COMPILER_GCC)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

template<class decompression_settings_type>
inline void seek_v0(persistent_scalar_decompression_context_v0& context, float sample_time, sample_rounding_policy rounding_policy)
{
Expand Down Expand Up @@ -209,6 +217,11 @@ namespace acl
context.key_frame_bit_offsets[1] = key_frame1 * scalars_header.num_bits_per_frame;
}

// Restore our warnings
#if defined(RTM_COMPILER_GCC)
#pragma GCC diagnostic pop
#endif

template<class decompression_settings_type, class track_writer_type>
inline void decompress_tracks_v0(const persistent_scalar_decompression_context_v0& context, track_writer_type& writer)
{
Expand Down

0 comments on commit 62566a3

Please sign in to comment.