{"id":18284,"url":"https://patchwork.libcamera.org/api/patches/18284/?format=json","web_url":"https://patchwork.libcamera.org/patch/18284/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230214121448.54918-1-ecurtin@redhat.com>","date":"2023-02-14T12:14:49","name":"[libcamera-devel,v2] cam: file_sink: Fixes following errors with gcc-13","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"916b353c6037221f613f61008e02619b3b3e9dd3","submitter":{"id":101,"url":"https://patchwork.libcamera.org/api/people/101/?format=json","name":"Eric Curtin","email":"ecurtin@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18284/mbox/","series":[{"id":3755,"url":"https://patchwork.libcamera.org/api/series/3755/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3755","date":"2023-02-14T12:14:49","name":"[libcamera-devel,v2] cam: file_sink: Fixes following errors with gcc-13","version":2,"mbox":"https://patchwork.libcamera.org/series/3755/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18284/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18284/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id DD946BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Feb 2023 12:16:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CD6ED625F4;\n\tTue, 14 Feb 2023 13:16:08 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 53730625DF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Feb 2023 13:16:07 +0100 (CET)","from mail-wm1-f70.google.com (mail-wm1-f70.google.com\n\t[209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id\n\tus-mta-225-CnKgllymPlG5rSQNGvpJcA-1; Tue, 14 Feb 2023 07:16:05 -0500","by mail-wm1-f70.google.com with SMTP id\n\tl38-20020a05600c1d2600b003ddff4b9a40so8545259wms.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Feb 2023 04:16:04 -0800 (PST)","from localhost.localdomain\n\t([2001:bb6:963d:9e00:7585:fe90:1658:512f])\n\tby smtp.gmail.com with ESMTPSA id\n\the7-20020a05600c540700b003e1f6e18c95sm1481898wmb.21.2023.02.14.04.16.01\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 14 Feb 2023 04:16:02 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1676376968;\n\tbh=jkW/HKMRB0WHC8FJ1K3xkUjpTeCPNBeurYvn+0k1bKs=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=HwYxWmLvGvGxoRANqzra2+5f6mjvxWr2WNS3H2f/FCYGqtd6n/xNxsOdcLeHho3Wl\n\tjF+4dJEQd4XuCTPxVGVqy/4nX2mhEGLyjN4rsevHPRgH+Z2WpW7fzIDdp79UXTktrO\n\tfwwaMWwYXQAx28h9XfVEpX5cBEv+Qowb0vCPHJ0xsS44smTXQAaIQJH36AV3alZrCw\n\tZdYO8oNyOgF8fFlUjvi0M4WNInvHYWaRiIrsNEgY/QJdImdwPFEWXvn5V8MGEmqzuD\n\tPphspGnjFBBQtgY6Jt+zsKYkbeiO8fFtA3JOPsOeDe8kt/cL9RfbzXgeQJuzBAh/TI\n\t5BdjZxClpomWQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1676376966;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding;\n\tbh=rss/3iY3yquhKZM8hl8/PDAH4cQ5H8vUwXboU/osCH4=;\n\tb=akSHG4BFW2KCQrbuSHhwp+AngHdwJt7TWFGN92BSExPS8eOA2KoqjT6qJiBbcyG376Fw3G\n\tIXKvltkpl/Z8yH7xZUSWLYSYAcfX6h6QxP5pJIbLEkc3jKB98rj7p9GkTElYeiPbPd6qpi\n\tHXboTdPPtaP6EvvWFrFvc/8uovhrOqk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"akSHG4BF\"; \n\tdkim-atps=neutral","X-MC-Unique":"CnKgllymPlG5rSQNGvpJcA-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=rss/3iY3yquhKZM8hl8/PDAH4cQ5H8vUwXboU/osCH4=;\n\tb=7qKKeV7DWbka8UToLi04/zuMXCWPfIaCKX082mKeycbL/08QKJwQ9FPYwHHGEdh5xH\n\tbMIwYZHJMtbfH0O1bfgfYcqIOczPA14ODVS2tIfqfzeMcXxTtFuM26iP8Uwzv1pGUCO2\n\tL2klXHvneyfG2p5yegVq9yNZyTU/zMh/81BT7rZ785/qVPNuon8DfHVyuiGB4Aj0gswO\n\tvTLkZbVjjSXnELc7equ/uQb32cvy0rAc7kWg1de67LBGHg29LOtvEbrm7XM6vmdcoupY\n\tqOkmtfVbp+sg+Lyu2MHQkRiBhbhvHlqQ1F/PGyYEk8bPYwpLukAZZ8eDfEhVAxsUEo6u\n\t8SoA==","X-Gm-Message-State":"AO0yUKXeXgvsjqVuWFOjZSKQ/rvT0bIurveZWKDaiiRhwEXva+u1fCkn\n\twJsTBB0i52plLRTPrge1AQgCLCAPbcf+Fh4K4XSvm43/XBFvxRWBg6+uB4pJZYU+TtAK+LisS1E\n\tURnPi//pNfvxsXTCXIfO1n20ftBsrRmtMueOIQi704GJ73+50exISnUmUhXQ/7Q9dPQP62aM/Zr\n\t4DsubQckEW1B4vK8QOvEA=","X-Received":["by 2002:a7b:cbd2:0:b0:3da:fc30:bfc5 with SMTP id\n\tn18-20020a7bcbd2000000b003dafc30bfc5mr1818346wmi.13.1676376963718; \n\tTue, 14 Feb 2023 04:16:03 -0800 (PST)","by 2002:a7b:cbd2:0:b0:3da:fc30:bfc5 with SMTP id\n\tn18-20020a7bcbd2000000b003dafc30bfc5mr1818326wmi.13.1676376963384; \n\tTue, 14 Feb 2023 04:16:03 -0800 (PST)"],"X-Google-Smtp-Source":"AK7set94pFN24eajt+loix69QMSKIsDnTQhZleNTH+tyBuEj4G9ZulvplWioQ3Ks/JT6G971hI78UQ==","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 14 Feb 2023 12:14:49 +0000","Message-Id":"<20230214121448.54918-1-ecurtin@redhat.com>","X-Mailer":"git-send-email 2.39.1","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain; charset=\"US-ASCII\"; x-default=true","Subject":"[libcamera-devel] [PATCH v2] cam: file_sink: Fixes following errors\n\twith gcc-13","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Eric Curtin via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Eric Curtin <ecurtin@redhat.com>","Cc":"Khem Raj <raj.khem@gmail.com>, wtaymans@redhat.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"../git/src/cam/file_sink.cpp:92:45: error: possibly dangling reference to a temporary [-Werror=dangling-reference]\n   92 |                 const FrameMetadata::Plane &meta = buffer->metadata().planes()[i];\n      |                                             ^~~~\n../git/src/cam/file_sink.cpp:92:81: note: the temporary was destroyed at the end of the full expression '(& buffer->libcamera::FrameBuffer::metadata())->libcamera::FrameMetadata::planes().libcamera::Span<const libcamera::FrameMetadata::Plane>::operator[](i)'\n   92 |                 const FrameMetadata::Plane &meta = buffer->metadata().planes()[i];\n      |                                                                                 ^\ncc1plus: all warnings being treated as errors\n\nCo-developed-by: Khem Raj <raj.khem@gmail.com>\nSigned-off-by: Eric Curtin <ecurtin@redhat.com>\n---\nChanges in v2:\n\n- Added const\n- Made patch mergeable by accounting for new directory structure\n---\n src/apps/cam/file_sink.cpp | 9 ++++-----\n 1 file changed, 4 insertions(+), 5 deletions(-)","diff":"diff --git a/src/apps/cam/file_sink.cpp b/src/apps/cam/file_sink.cpp\nindex b32aad24..d41569c9 100644\n--- a/src/apps/cam/file_sink.cpp\n+++ b/src/apps/cam/file_sink.cpp\n@@ -114,13 +114,12 @@ void FileSink::writeBuffer(const Stream *stream, FrameBuffer *buffer,\n \t}\n \n \tfor (unsigned int i = 0; i < buffer->planes().size(); ++i) {\n-\t\tconst FrameMetadata::Plane &meta = buffer->metadata().planes()[i];\n-\n+\t\tconst unsigned int bytesused = buffer->metadata().planes()[i].bytesused;\n \t\tSpan<uint8_t> data = image->data(i);\n-\t\tunsigned int length = std::min<unsigned int>(meta.bytesused, data.size());\n+\t\tconst unsigned int length = std::min<unsigned int>(bytesused, data.size());\n \n-\t\tif (meta.bytesused > data.size())\n-\t\t\tstd::cerr << \"payload size \" << meta.bytesused\n+\t\tif (bytesused > data.size())\n+\t\t\tstd::cerr << \"payload size \" << bytesused\n \t\t\t\t  << \" larger than plane size \" << data.size()\n \t\t\t\t  << std::endl;\n \n","prefixes":["libcamera-devel","v2"]}