Мы используем куки, чтобы пользоваться сайтом было удобно.
Хорошо
to the top

Вебинар: Практическая интеграция PVS-Studio и SourceCraft - 15.07

>
>
>
Примеры ошибок, обнаруженных с...

Примеры ошибок, обнаруженных с помощью диагностики V1047

V1047. Lifetime of the lambda is greater than lifetime of the local variable captured by reference.


OrcaSlicer

V1047 Lifetime of the lambda is greater than lifetime of the local variable 'do_stop' captured by reference. FillBedJob.cpp 250


void FillBedJob::process(Ctl &ctl)
{
  // ....
  bool do_stop = false;
  // ....
  params.on_packed =
    [&do_stop] (const ArrangePolygon &ap)
    {
      do_stop = ap.bed_idx > 0 && ap.priority == 0;
    };
  // ....
}

Similar errors can be found in some other places:

  • V1047 Lifetime of the lambda is greater than lifetime of the local variable 'statustxt' captured by reference. FillBedJob.cpp 245
  • V1047 Lifetime of the lambda is greater than lifetime of the local variable 'do_stop' captured by reference. FillBedJob.cpp 241