commit | 388c142866f36f0459f24ac0ff6b9aa15d6035c9 | [log] [tgz] |
---|---|---|
author | Sergiu Deitsch <sergiu.deitsch@gmail.com> | Sun Aug 14 12:49:45 2022 +0200 |
committer | Sameer Agarwal <sameeragarwal@google.com> | Tue Aug 16 21:23:12 2022 +0000 |
tree | fb7f054e6b4731f8dce6dc37f10016513dce2d38 | |
parent | 9ec4f7e44a2a28168052d052ffb621b9cefaee41 [diff] |
Fix GCC 12.1.1 LTO -Walloc-size-larger-than= warnings With -flto=auto, GCC emits multiple warnings in release builds such as In function ‘make_unique’, inlined from ‘Create’ at ceres-solver/internal/ceres/scratch_evaluate_preparer.cc:43:75, inlined from ‘CreateEvaluatePreparers’ at ceres-solver/internal/ceres/compressed_row_jacobian_writer.h:95:66, inlined from ‘__ct ’ at ceres-solver/internal/ceres/program_evaluator.h:120:9, inlined from ‘Evaluate.constprop.isra’ at ceres-solver/internal/ceres/problem_impl.cc:695:65: /usr/include/c++/12.1.1/bits/unique_ptr.h:1080:30: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] 1080 | { return unique_ptr<_Tp>(new remove_extent_t<_Tp>[__num]()); } | ^ because a signed integer is used to specify the size of allocated arrays instead of the expected unsigned (specifically, std::size_t) without checking for negative values at the call site. Change-Id: I923b1d074241535426bfea041568ef1dc7f3ec86
Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.
Please see ceres-solver.org for more information.