Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Enable more compiler warnings in debug mode #49

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

paleolimbot
Copy link
Owner

@paleolimbot paleolimbot commented Nov 22, 2024

This PR fixes some compiler warnings and enables more of them in a normal debug build such that they are spotted early.

@paleolimbot paleolimbot marked this pull request as ready for review November 22, 2024 17:27
@paleolimbot paleolimbot merged commit dc86a45 into main Nov 22, 2024
5 checks passed
@jorisvandenbossche
Copy link
Collaborator

Starting with this commit, I get build errors on conda if enabling DEBUG mode:

[ 33%] Building CXX object CMakeFiles/s2geography.dir/src/s2geography/build.cc.o
In file included from /home/joris/conda/envs/spherely-dev/include/absl/container/inlined_vector.h:53,
                 from /home/joris/conda/envs/spherely-dev/include/absl/status/internal/status_internal.h:26,
                 from /home/joris/conda/envs/spherely-dev/include/absl/status/status.h:66,
                 from /home/joris/conda/envs/spherely-dev/include/s2/s2coder.h:23,
                 from /home/joris/conda/envs/spherely-dev/include/s2/s2point.h:27,
                 from /home/joris/conda/envs/spherely-dev/include/s2/s1angle.h:28,
                 from /home/joris/conda/envs/spherely-dev/include/s2/s2cell_id.h:43,
                 from /home/joris/scipy/repos/s2geography/src/s2geography/geography.h:4,
                 from /home/joris/scipy/repos/s2geography/src/s2geography/distance.h:4,
                 from /home/joris/scipy/repos/s2geography/src/s2geography/distance.cc:2:
In member function 'void absl::lts_20240116::inlined_vector_internal::Storage<T, N, A>::MemcpyFrom(const absl::lts_20240116::inlined_vector_internal::Storage<T, N, A>&) [with T = S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry; long unsigned int N = 16; A = std::allocator<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry>]',
    inlined from 'void absl::lts_20240116::InlinedVector<T, N, A>::MoveAssignment(MemcpyPolicy, absl::lts_20240116::InlinedVector<T, N, A>&&) [with T = S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry; long unsigned int N = 16; A = std::allocator<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry>]' at /home/joris/conda/envs/spherely-dev/include/absl/container/inlined_vector.h:856:24,
    inlined from 'absl::lts_20240116::InlinedVector<T, N, A>& absl::lts_20240116::InlinedVector<T, N, A>::operator=(absl::lts_20240116::InlinedVector<T, N, A>&&) [with T = S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry; long unsigned int N = 16; A = std::allocator<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry>]' at /home/joris/conda/envs/spherely-dev/include/absl/container/inlined_vector.h:548:21,
    inlined from 'std::priority_queue<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, absl::lts_20240116::InlinedVector<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, 16, std::allocator<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >, std::less<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >& std::priority_queue<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, absl::lts_20240116::InlinedVector<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, 16, std::allocator<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >, std::less<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >::operator=(std::priority_queue<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, absl::lts_20240116::InlinedVector<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, 16, std::allocator<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >, std::less<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >&&)' at /home/joris/conda/envs/spherely-dev/lib/gcc/x86_64-conda-linux-gnu/12.4.0/include/c++/bits/stl_queue.h:498:11,
    inlined from 'void S2ClosestEdgeQueryBase<Distance>::FindClosestEdgesOptimized() [with Distance = S2MinDistance]' at /home/joris/conda/envs/spherely-dev/include/s2/s2closest_edge_query_base.h:666:14:
/home/joris/conda/envs/spherely-dev/include/absl/container/internal/inlined_vector.h:532:5: error: '<unnamed>.std::priority_queue<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, absl::lts_20240116::InlinedVector<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, 16, std::allocator<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >, std::less<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >::c.absl::lts_20240116::InlinedVector<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, 16, std::allocator<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >::storage_.absl::lts_20240116::inlined_vector_internal::Storage<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry, 16, std::allocator<S2ClosestEdgeQueryBase<S2MinDistance>::QueueEntry> >::data_' may be used uninitialized [-Werror=maybe-uninitialized]
  532 |     data_ = other_storage.data_;
      |     ^~~~~

Something related to the abseil conda package might not like all of those compiler directives?

@paleolimbot
Copy link
Owner Author

Probably. I'll make those compiler warning checks opt-in (Google famously doesn't care about them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants