[{"id":25974,"web_url":"https://patchwork.libcamera.org/comment/25974/","msgid":"<Y4n+xJdFdyY1DHth@pendragon.ideasonboard.com>","date":"2022-12-02T13:33:56","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Fri, Dec 02, 2022 at 02:27:06PM +0100, Jacopo Mondi via libcamera-devel wrote:\n> The \"basename\" function from the standard C library is defined in the\n> libgen.h header.\n> \n> Include it to avoid errors triggered by -Wimplicit-function-declaration\n> \n> ../utils/ipu3/ipu3-pack.c:21:47: error: implicit declaration of function\n> 'basename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  utils/ipu3/ipu3-pack.c   | 1 +\n>  utils/ipu3/ipu3-unpack.c | 1 +\n>  2 files changed, 2 insertions(+)\n> \n> diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c\n> index decbfc6c397a..27af44068956 100644\n> --- a/utils/ipu3/ipu3-pack.c\n> +++ b/utils/ipu3/ipu3-pack.c\n> @@ -8,6 +8,7 @@\n>  \n>  #include <errno.h>\n>  #include <fcntl.h>\n> +#include <libgen.h>\n>  #include <stdint.h>\n>  #include <stdio.h>\n>  #include <string.h>\n> diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c\n> index 9d2c1200d932..aa67e0b0ecf5 100644\n> --- a/utils/ipu3/ipu3-unpack.c\n> +++ b/utils/ipu3/ipu3-unpack.c\n> @@ -8,6 +8,7 @@\n>  \n>  #include <errno.h>\n>  #include <fcntl.h>\n> +#include <libgen.h>\n>  #include <stdint.h>\n>  #include <stdio.h>\n>  #include <string.h>","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 1A409BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Dec 2022 13:34:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8675C63336;\n\tFri,  2 Dec 2022 14:34:00 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 78DD160483\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Dec 2022 14:33:58 +0100 (CET)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E0A806E0;\n\tFri,  2 Dec 2022 14:33:57 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669988040;\n\tbh=QCmCfudHXQhfqCF1cey9HXnBJaMsxVDL1c7S2VxMz40=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=SI7av6KmZYkly6jnPc6IGTYWp9F6OfaRurQwhip5eLCPltH1kla5JzE1VG3krz8Z9\n\tYI5WnVb6i8APg2KujqIhaenvJmSn0THEyNwZvAC5N+TL16LaYViUDC02r5khJkt6tQ\n\t4x0622/u9vB9iy3KAN+YP5ibNFvgm6yEh4MFXuhrJTQcQQpHah5I7Mwi0eoVEcH6cR\n\t6LjE9nTyjt3PVtPavUHqhyEAIEz6w/pmabElia9/ytyPTtjlph6VDM1OpWRxb1Jzan\n\tfO8lEIQOer+sH5CiJkefDVICwydgZhA4Smz553a4qgK4PLLc1prYQ47eiDUBz5b3A8\n\teEGZ+R4uD3GHw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669988038;\n\tbh=QCmCfudHXQhfqCF1cey9HXnBJaMsxVDL1c7S2VxMz40=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=eq7L+zb/jqE815BoBuAb9G7oNFa/GFAQSavbw5DMofs8o3RPcvIb9PZK5SLJ/x4dE\n\t+IOEKm+yR7SDCmWI9geZr6I7OA4ZNSLBluIifs6zioQ/oeGiEF4gbiIYceQDJgigqz\n\tAaXJOpNQ4acNawm0moPuruDKVYZkC1VHMDntLZGo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"eq7L+zb/\"; dkim-atps=neutral","Date":"Fri, 2 Dec 2022 15:33:56 +0200","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<Y4n+xJdFdyY1DHth@pendragon.ideasonboard.com>","References":"<20221202132706.15675-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221202132706.15675-1-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25975,"web_url":"https://patchwork.libcamera.org/comment/25975/","msgid":"<85376d49-5113-cd1d-da34-6ee0deeb1bfc@ideasonboard.com>","date":"2022-12-02T13:33:37","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hello,\n\nThank you for the patch\n\nOn 12/2/22 9:27 PM, Jacopo Mondi via libcamera-devel wrote:\n> The \"basename\" function from the standard C library is defined in the\n> libgen.h header.\n>\n> Include it to avoid errors triggered by -Wimplicit-function-declaration\n>\n> ../utils/ipu3/ipu3-pack.c:21:47: error: implicit declaration of function\n> 'basename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]\n>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   utils/ipu3/ipu3-pack.c   | 1 +\n>   utils/ipu3/ipu3-unpack.c | 1 +\n>   2 files changed, 2 insertions(+)\n>\n> diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c\n> index decbfc6c397a..27af44068956 100644\n> --- a/utils/ipu3/ipu3-pack.c\n> +++ b/utils/ipu3/ipu3-pack.c\n> @@ -8,6 +8,7 @@\n>   \n>   #include <errno.h>\n>   #include <fcntl.h>\n> +#include <libgen.h>\n>   #include <stdint.h>\n>   #include <stdio.h>\n>   #include <string.h>\n> diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c\n> index 9d2c1200d932..aa67e0b0ecf5 100644\n> --- a/utils/ipu3/ipu3-unpack.c\n> +++ b/utils/ipu3/ipu3-unpack.c\n> @@ -8,6 +8,7 @@\n>   \n>   #include <errno.h>\n>   #include <fcntl.h>\n> +#include <libgen.h>\n>   #include <stdint.h>\n>   #include <stdio.h>\n>   #include <string.h>","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 4F722BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Dec 2022 13:34:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0A0E163336;\n\tFri,  2 Dec 2022 14:34:39 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BB6A860483\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Dec 2022 14:34:37 +0100 (CET)","from [192.168.10.186] (unknown [210.186.188.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E8AC66E0;\n\tFri,  2 Dec 2022 14:34:36 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669988079;\n\tbh=szsvfyTknTdgF5KwKSLmggaV32FYc99FPtchbvuuC44=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=WXT9dtAfTQUFpM0GnktdJ85hDpqIGVsuoA83G6zZTIw4JAQOT8hGI9m4e0MW7EmLu\n\tXOPjc621//NlFn/PT93xhW+WLXGggR6NxhUzE/ZTh9IoGIk2ov/9KYHRLwE+nUmCMN\n\t9pXYj36Wt6aAmJ2NynZYqqaSXxguarI7ogtEYGp6ipN05/AkfYF7IED4QVQD2NhWG/\n\two9u89ijrvcI1I+PdYjWvpOrP22OF5enLfco4p4o8292OFnT8vJjnTnCBRbHa5DxaC\n\tHTwi5ueiySOC3feKuR8QZN702fzczq8FlEC4l5bJZmEbruBRguu38Vxfs5vRVtKbAV\n\tiQQs0Y5oLaL5g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669988077;\n\tbh=szsvfyTknTdgF5KwKSLmggaV32FYc99FPtchbvuuC44=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=VpGVLtv/3I96VLDA8cdMXZVQ8Lk780HdXWBQBYEMQdIdo7YcxDPX+wHNWklO8/JDL\n\th0HsUfcA+fndecGV20H9q1QleNm+LRRGZXgdm7K2nCjq0d44RIw32pAWRolDilg+ZT\n\tbYVCpAL0T53zo8vyXVddQoOvInmqjMq63EBKJ4Us="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"VpGVLtv/\"; dkim-atps=neutral","Message-ID":"<85376d49-5113-cd1d-da34-6ee0deeb1bfc@ideasonboard.com>","Date":"Fri, 2 Dec 2022 21:33:37 +0800","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.5.0","Content-Language":"en-US","To":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","References":"<20221202132706.15675-1-jacopo@jmondi.org>","In-Reply-To":"<20221202132706.15675-1-jacopo@jmondi.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25978,"web_url":"https://patchwork.libcamera.org/comment/25978/","msgid":"<20221202134827.feiigyswiay7gwgw@uno.localdomain>","date":"2022-12-02T13:48:27","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Not really...\n\nI get with clang\n\n../utils/ipu3/ipu3-unpack.c:21:63: error: passing argument 1 of ‘__xpg_basename’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]\n   21 |         printf(\"Usage: %s input-file output-file\\n\", basename(argv0));\n\nSorry, I should have tested before, but it seemed trivial.\n\nI now wonder what 'basename' we were calling, or better, to which\nfunction prototype we were referring to, which didn't trigger such\nerror...\n\nOn Fri, Dec 02, 2022 at 03:33:56PM +0200, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Fri, Dec 02, 2022 at 02:27:06PM +0100, Jacopo Mondi via libcamera-devel wrote:\n> > The \"basename\" function from the standard C library is defined in the\n> > libgen.h header.\n> >\n> > Include it to avoid errors triggered by -Wimplicit-function-declaration\n> >\n> > ../utils/ipu3/ipu3-pack.c:21:47: error: implicit declaration of function\n> > 'basename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> > ---\n> >  utils/ipu3/ipu3-pack.c   | 1 +\n> >  utils/ipu3/ipu3-unpack.c | 1 +\n> >  2 files changed, 2 insertions(+)\n> >\n> > diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c\n> > index decbfc6c397a..27af44068956 100644\n> > --- a/utils/ipu3/ipu3-pack.c\n> > +++ b/utils/ipu3/ipu3-pack.c\n> > @@ -8,6 +8,7 @@\n> >\n> >  #include <errno.h>\n> >  #include <fcntl.h>\n> > +#include <libgen.h>\n> >  #include <stdint.h>\n> >  #include <stdio.h>\n> >  #include <string.h>\n> > diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c\n> > index 9d2c1200d932..aa67e0b0ecf5 100644\n> > --- a/utils/ipu3/ipu3-unpack.c\n> > +++ b/utils/ipu3/ipu3-unpack.c\n> > @@ -8,6 +8,7 @@\n> >\n> >  #include <errno.h>\n> >  #include <fcntl.h>\n> > +#include <libgen.h>\n> >  #include <stdint.h>\n> >  #include <stdio.h>\n> >  #include <string.h>\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 505A6BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Dec 2022 13:48:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8E75F63336;\n\tFri,  2 Dec 2022 14:48:32 +0100 (CET)","from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8563760483\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Dec 2022 14:48:30 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 41B03FF809;\n\tFri,  2 Dec 2022 13:48:28 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669988912;\n\tbh=gPxfriD7r0PS2o/teUSXc5nauIjdUADDFLkYXThYQUk=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=YXfZ088JU7iRtG7qNBYvb/tj1UjTrc5j3fT3WaWULPGv194s4MVXfC6NXf6WuR4sU\n\tlLppvBnyMXG07eD1CWrqSargy6r+GhnpdTqVHaUodCEfDD7q0FPGD1hsMhC4RfPGk8\n\t/mqkk0cNd9jPoeGWn53T1bcVsy6L1z9GyYhkbhZRFAEFVxlGK7omu0mAJ0HMw8acFN\n\tMYJ93u3vDYdFfRFJpTNAw4JC9NGn7K1USClWgyHQiPOdX0lOrkrgWlV+AS2de0eCAM\n\tsMrMi1itRstaeMVsBTApmXenov2aATX4YTwJnFB8sG6LDz9vK2iMJ6FrUiES3QqNq2\n\tw29x8gcTBQZ7g==","Date":"Fri, 2 Dec 2022 14:48:27 +0100","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20221202134827.feiigyswiay7gwgw@uno.localdomain>","References":"<20221202132706.15675-1-jacopo@jmondi.org>\n\t<Y4n+xJdFdyY1DHth@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<Y4n+xJdFdyY1DHth@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25981,"web_url":"https://patchwork.libcamera.org/comment/25981/","msgid":"<Y4oEq3G0lFfbo1Xz@pendragon.ideasonboard.com>","date":"2022-12-02T13:59:07","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Dec 02, 2022 at 02:48:27PM +0100, Jacopo Mondi wrote:\n> Not really...\n> \n> I get with clang\n> \n> ../utils/ipu3/ipu3-unpack.c:21:63: error: passing argument 1 of ‘__xpg_basename’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]\n>    21 |         printf(\"Usage: %s input-file output-file\\n\", basename(argv0));\n> \n> Sorry, I should have tested before, but it seemed trivial.\n> \n> I now wonder what 'basename' we were calling, or better, to which\n> function prototype we were referring to, which didn't trigger such\n> error...\n\nFrom libgen.h:\n\n/* Return final component of PATH.\n\n   This is the weird XPG version of this function.  It sometimes will\n   modify its argument.  Therefore we normally use the GNU version (in\n   <string.h>) and only if this header is included make the XPG\n   version available under the real name.  */\nextern char *__xpg_basename (char *__path) __THROW;\n#define basename        __xpg_basename\n\nSo we're using the string.h version. The basename manpage mentions\n\nNOTES\n       There are two different versions of basename() - the POSIX version described above, and the GNU version, which one gets after\n\n               #define _GNU_SOURCE         /* See feature_test_macros(7) */\n               #include <string.h>\n\n       The GNU version never modifies its argument, and returns the empty string when path has a trailing slash, and in particular also when it is \"/\".  There is  no  GNU  version  of\n       dirname().\n\n       With glibc, one gets the POSIX version of basename() when <libgen.h> is included, and the GNU version otherwise.\n\nWe have utils::basename() to support different libc versions, but we\ncan't use it in utils/. Have you encountered this when compiling for\nAndroid ? Maybe we can disable compilation of those utilities instead ?\n\n> On Fri, Dec 02, 2022 at 03:33:56PM +0200, Laurent Pinchart wrote:\n> > Hi Jacopo,\n> >\n> > Thank you for the patch.\n> >\n> > On Fri, Dec 02, 2022 at 02:27:06PM +0100, Jacopo Mondi via libcamera-devel wrote:\n> > > The \"basename\" function from the standard C library is defined in the\n> > > libgen.h header.\n> > >\n> > > Include it to avoid errors triggered by -Wimplicit-function-declaration\n> > >\n> > > ../utils/ipu3/ipu3-pack.c:21:47: error: implicit declaration of function\n> > > 'basename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]\n> > >\n> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> >\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >\n> > > ---\n> > >  utils/ipu3/ipu3-pack.c   | 1 +\n> > >  utils/ipu3/ipu3-unpack.c | 1 +\n> > >  2 files changed, 2 insertions(+)\n> > >\n> > > diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c\n> > > index decbfc6c397a..27af44068956 100644\n> > > --- a/utils/ipu3/ipu3-pack.c\n> > > +++ b/utils/ipu3/ipu3-pack.c\n> > > @@ -8,6 +8,7 @@\n> > >\n> > >  #include <errno.h>\n> > >  #include <fcntl.h>\n> > > +#include <libgen.h>\n> > >  #include <stdint.h>\n> > >  #include <stdio.h>\n> > >  #include <string.h>\n> > > diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c\n> > > index 9d2c1200d932..aa67e0b0ecf5 100644\n> > > --- a/utils/ipu3/ipu3-unpack.c\n> > > +++ b/utils/ipu3/ipu3-unpack.c\n> > > @@ -8,6 +8,7 @@\n> > >\n> > >  #include <errno.h>\n> > >  #include <fcntl.h>\n> > > +#include <libgen.h>\n> > >  #include <stdint.h>\n> > >  #include <stdio.h>\n> > >  #include <string.h>","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 818A3BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Dec 2022 13:59:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 056346333F;\n\tFri,  2 Dec 2022 14:59:12 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6688E60483\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Dec 2022 14:59:10 +0100 (CET)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BAC7F6E0;\n\tFri,  2 Dec 2022 14:59:09 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669989552;\n\tbh=4VXK4DCS2JygBYTe60PO7rMl+iQop437Zn8JMJBD5Vw=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=XD/hgsTS3doGB+KyyJlLCMc2ipMjdEkcgw0BF9cn0QFDPSAFLzbxMgOBAbf7wKHr9\n\tASE+olyllnzWpNUk2QlhkXy20Jl2H83tH8sLJitbnt0hH+8Tczn6X9jicCBVZr3VyA\n\tIOkFuyjBPTXCCm7VbSVSW5+uyJnkF2yHg47gCt/TzP7wzLTP1JFXnLKlJfyS/WUN7v\n\tQmRkDGNZGtyBoS9XXa2uHZTKXJw5MD7wfXLFl4alAZmTlIV7mcbiIsuPv0X6Ube7di\n\tDVXUsCbQS/o1zuKuulqH80GB7zewkaSbI+VR6QPc7s+04cxx3tDI/K2l/RiTgHJrVg\n\tLgIOA7Ouwr9lg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669989550;\n\tbh=4VXK4DCS2JygBYTe60PO7rMl+iQop437Zn8JMJBD5Vw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CXWqDvlHQ+21l4a0UF2H+BiF0/jHEou9FnQrzrlD3I941aewSA7tGGkohxHDRJIgJ\n\t2mG0roT6+3aSJtGCRpeB9+wd2YQIXxZ+XkRwepsh+q1m1JZQQrIG6ODN0m02fiAhK+\n\tEQBoJU+52YBYG/4ij0UDQEXerPnsXvKt4oSK4VJQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"CXWqDvlH\"; dkim-atps=neutral","Date":"Fri, 2 Dec 2022 15:59:07 +0200","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<Y4oEq3G0lFfbo1Xz@pendragon.ideasonboard.com>","References":"<20221202132706.15675-1-jacopo@jmondi.org>\n\t<Y4n+xJdFdyY1DHth@pendragon.ideasonboard.com>\n\t<20221202134827.feiigyswiay7gwgw@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20221202134827.feiigyswiay7gwgw@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25983,"web_url":"https://patchwork.libcamera.org/comment/25983/","msgid":"<20221202141521.dqmd4zx4i3vbghj2@uno.localdomain>","date":"2022-12-02T14:15:21","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Fri, Dec 02, 2022 at 03:59:07PM +0200, Laurent Pinchart wrote:\n> On Fri, Dec 02, 2022 at 02:48:27PM +0100, Jacopo Mondi wrote:\n> > Not really...\n> >\n> > I get with clang\n> >\n> > ../utils/ipu3/ipu3-unpack.c:21:63: error: passing argument 1 of ‘__xpg_basename’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]\n> >    21 |         printf(\"Usage: %s input-file output-file\\n\", basename(argv0));\n> >\n> > Sorry, I should have tested before, but it seemed trivial.\n> >\n> > I now wonder what 'basename' we were calling, or better, to which\n> > function prototype we were referring to, which didn't trigger such\n> > error...\n>\n> From libgen.h:\n>\n> /* Return final component of PATH.\n>\n>    This is the weird XPG version of this function.  It sometimes will\n>    modify its argument.  Therefore we normally use the GNU version (in\n>    <string.h>) and only if this header is included make the XPG\n>    version available under the real name.  */\n> extern char *__xpg_basename (char *__path) __THROW;\n> #define basename        __xpg_basename\n>\n> So we're using the string.h version. The basename manpage mentions\n\nSpot on, I read the header file after sending the email....\n\n>\n> NOTES\n>        There are two different versions of basename() - the POSIX version described above, and the GNU version, which one gets after\n>\n>                #define _GNU_SOURCE         /* See feature_test_macros(7) */\n>                #include <string.h>\n>\n>        The GNU version never modifies its argument, and returns the empty string when path has a trailing slash, and in particular also when it is \"/\".  There is  no  GNU  version  of\n>        dirname().\n>\n>        With glibc, one gets the POSIX version of basename() when <libgen.h> is included, and the GNU version otherwise.\n>\n> We have utils::basename() to support different libc versions, but we\n> can't use it in utils/. Have you encountered this when compiling for\n> Android ? Maybe we can disable compilation of those utilities instead ?\n>\n\nYes, I am trying compile with the NDK.\n\nI think we can safely remove those scripts from the build (I wonder\nhow this would be decided), but I anticipate already that we'll have a\nfew hickups as in example:\n\n../src/libcamera/media_device.cpp:167:2: error: use of undeclared identifier 'lockf'\n        lockf(fd_.get(), F_ULOCK, 0);\n\nAs Android has instead the BSD-conformant flock(). So expect more\nwrappers in utils::  (hopefully not many)\n\n> > On Fri, Dec 02, 2022 at 03:33:56PM +0200, Laurent Pinchart wrote:\n> > > Hi Jacopo,\n> > >\n> > > Thank you for the patch.\n> > >\n> > > On Fri, Dec 02, 2022 at 02:27:06PM +0100, Jacopo Mondi via libcamera-devel wrote:\n> > > > The \"basename\" function from the standard C library is defined in the\n> > > > libgen.h header.\n> > > >\n> > > > Include it to avoid errors triggered by -Wimplicit-function-declaration\n> > > >\n> > > > ../utils/ipu3/ipu3-pack.c:21:47: error: implicit declaration of function\n> > > > 'basename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]\n> > > >\n> > > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > >\n> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > >\n> > > > ---\n> > > >  utils/ipu3/ipu3-pack.c   | 1 +\n> > > >  utils/ipu3/ipu3-unpack.c | 1 +\n> > > >  2 files changed, 2 insertions(+)\n> > > >\n> > > > diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c\n> > > > index decbfc6c397a..27af44068956 100644\n> > > > --- a/utils/ipu3/ipu3-pack.c\n> > > > +++ b/utils/ipu3/ipu3-pack.c\n> > > > @@ -8,6 +8,7 @@\n> > > >\n> > > >  #include <errno.h>\n> > > >  #include <fcntl.h>\n> > > > +#include <libgen.h>\n> > > >  #include <stdint.h>\n> > > >  #include <stdio.h>\n> > > >  #include <string.h>\n> > > > diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c\n> > > > index 9d2c1200d932..aa67e0b0ecf5 100644\n> > > > --- a/utils/ipu3/ipu3-unpack.c\n> > > > +++ b/utils/ipu3/ipu3-unpack.c\n> > > > @@ -8,6 +8,7 @@\n> > > >\n> > > >  #include <errno.h>\n> > > >  #include <fcntl.h>\n> > > > +#include <libgen.h>\n> > > >  #include <stdint.h>\n> > > >  #include <stdio.h>\n> > > >  #include <string.h>\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 B55C9BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Dec 2022 14:15:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2EBD263336;\n\tFri,  2 Dec 2022 15:15:24 +0100 (CET)","from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::226])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 679F260483\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Dec 2022 15:15:23 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id E89FFC0009;\n\tFri,  2 Dec 2022 14:15:22 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669990524;\n\tbh=OLpbD7bZ9Hj0pjCSi4JgfS1fLr98FNyQDyi93Gdp/Jk=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=GZ2uytBpeRCY9MALas0JU2yZqTy7ixgkxucLDxiwgYQaAvI/wAN9g3V9jhAYanev2\n\tbpBTDsOdOPHeMvFa1WpIGEDSdyxUrT08D97pqJhbHZpcWJp5rLmYWfpzJpP3xaJ7f5\n\tbafxxLI6M40o0Ndwk5ZFGwv4sOe/Mu6hVpxJLAR9I+PiIdNfJjG/+O8k8b6o1ZMYxo\n\tkOFuFr+uPY7kmx55NDwZ4OsqjjH+wXW0rzCU0C3CbbUBlWv/+SXK885jve9sNiQjt7\n\tvl5pOiZ61G6vqyGy40q8ftyoUZeEevMsM3kY+JsAdT4GMaJ4kgjFFhIHOK3rhePV1p\n\tvClWp/sL7kXBQ==","Date":"Fri, 2 Dec 2022 15:15:21 +0100","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20221202141521.dqmd4zx4i3vbghj2@uno.localdomain>","References":"<20221202132706.15675-1-jacopo@jmondi.org>\n\t<Y4n+xJdFdyY1DHth@pendragon.ideasonboard.com>\n\t<20221202134827.feiigyswiay7gwgw@uno.localdomain>\n\t<Y4oEq3G0lFfbo1Xz@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<Y4oEq3G0lFfbo1Xz@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25985,"web_url":"https://patchwork.libcamera.org/comment/25985/","msgid":"<Y4oa909bD7RBr82a@pendragon.ideasonboard.com>","date":"2022-12-02T15:34:15","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Fri, Dec 02, 2022 at 03:15:21PM +0100, Jacopo Mondi wrote:\n> On Fri, Dec 02, 2022 at 03:59:07PM +0200, Laurent Pinchart wrote:\n> > On Fri, Dec 02, 2022 at 02:48:27PM +0100, Jacopo Mondi wrote:\n> > > Not really...\n> > >\n> > > I get with clang\n> > >\n> > > ../utils/ipu3/ipu3-unpack.c:21:63: error: passing argument 1 of ‘__xpg_basename’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]\n> > >    21 |         printf(\"Usage: %s input-file output-file\\n\", basename(argv0));\n> > >\n> > > Sorry, I should have tested before, but it seemed trivial.\n> > >\n> > > I now wonder what 'basename' we were calling, or better, to which\n> > > function prototype we were referring to, which didn't trigger such\n> > > error...\n> >\n> > From libgen.h:\n> >\n> > /* Return final component of PATH.\n> >\n> >    This is the weird XPG version of this function.  It sometimes will\n> >    modify its argument.  Therefore we normally use the GNU version (in\n> >    <string.h>) and only if this header is included make the XPG\n> >    version available under the real name.  */\n> > extern char *__xpg_basename (char *__path) __THROW;\n> > #define basename        __xpg_basename\n> >\n> > So we're using the string.h version. The basename manpage mentions\n> \n> Spot on, I read the header file after sending the email....\n> \n> >\n> > NOTES\n> >        There are two different versions of basename() - the POSIX version described above, and the GNU version, which one gets after\n> >\n> >                #define _GNU_SOURCE         /* See feature_test_macros(7) */\n> >                #include <string.h>\n> >\n> >        The GNU version never modifies its argument, and returns the empty string when path has a trailing slash, and in particular also when it is \"/\".  There is  no  GNU  version  of\n> >        dirname().\n> >\n> >        With glibc, one gets the POSIX version of basename() when <libgen.h> is included, and the GNU version otherwise.\n> >\n> > We have utils::basename() to support different libc versions, but we\n> > can't use it in utils/. Have you encountered this when compiling for\n> > Android ? Maybe we can disable compilation of those utilities instead ?\n> >\n> \n> Yes, I am trying compile with the NDK.\n> \n> I think we can safely remove those scripts from the build (I wonder\n> how this would be decided),\n\nMaybe a meson option ? Or doing so automatically based on a test at\nconfiguration time to see if there's a compliant basename() ? Or even a\ncheck on the platform type, if that's available.\n\n> but I anticipate already that we'll have a\n> few hickups as in example:\n> \n> ../src/libcamera/media_device.cpp:167:2: error: use of undeclared identifier 'lockf'\n>         lockf(fd_.get(), F_ULOCK, 0);\n> \n> As Android has instead the BSD-conformant flock(). So expect more\n> wrappers in utils::  (hopefully not many)\n\nWe could skip the whole locking on Android, as there will never be\nmultiple processes trying to use the same camera. However, the lockf()\nissue seems weird, it seems to be available in bionic.\n\n> > > On Fri, Dec 02, 2022 at 03:33:56PM +0200, Laurent Pinchart wrote:\n> > > > Hi Jacopo,\n> > > >\n> > > > Thank you for the patch.\n> > > >\n> > > > On Fri, Dec 02, 2022 at 02:27:06PM +0100, Jacopo Mondi via libcamera-devel wrote:\n> > > > > The \"basename\" function from the standard C library is defined in the\n> > > > > libgen.h header.\n> > > > >\n> > > > > Include it to avoid errors triggered by -Wimplicit-function-declaration\n> > > > >\n> > > > > ../utils/ipu3/ipu3-pack.c:21:47: error: implicit declaration of function\n> > > > > 'basename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]\n> > > > >\n> > > > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > > >\n> > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > >\n> > > > > ---\n> > > > >  utils/ipu3/ipu3-pack.c   | 1 +\n> > > > >  utils/ipu3/ipu3-unpack.c | 1 +\n> > > > >  2 files changed, 2 insertions(+)\n> > > > >\n> > > > > diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c\n> > > > > index decbfc6c397a..27af44068956 100644\n> > > > > --- a/utils/ipu3/ipu3-pack.c\n> > > > > +++ b/utils/ipu3/ipu3-pack.c\n> > > > > @@ -8,6 +8,7 @@\n> > > > >\n> > > > >  #include <errno.h>\n> > > > >  #include <fcntl.h>\n> > > > > +#include <libgen.h>\n> > > > >  #include <stdint.h>\n> > > > >  #include <stdio.h>\n> > > > >  #include <string.h>\n> > > > > diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c\n> > > > > index 9d2c1200d932..aa67e0b0ecf5 100644\n> > > > > --- a/utils/ipu3/ipu3-unpack.c\n> > > > > +++ b/utils/ipu3/ipu3-unpack.c\n> > > > > @@ -8,6 +8,7 @@\n> > > > >\n> > > > >  #include <errno.h>\n> > > > >  #include <fcntl.h>\n> > > > > +#include <libgen.h>\n> > > > >  #include <stdint.h>\n> > > > >  #include <stdio.h>\n> > > > >  #include <string.h>","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 790D1BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Dec 2022 15:34:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A7C856333F;\n\tFri,  2 Dec 2022 16:34:18 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 72CA060483\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Dec 2022 16:34:17 +0100 (CET)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D333C6E0;\n\tFri,  2 Dec 2022 16:34:16 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669995258;\n\tbh=1Zmi23CCq/9mIDPZHi23Sg8Jkyv95p+p5BlkjPy7VZc=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=zGph1psz8h4t8/xWWDIAcbLRY0ZJKhQ+6L+IkrYRfUeIoCD7z0YJyZQ4iYR50OJ69\n\tjg0ICfXBl54vSDq2EHofBwLG4TJHDKgMjcYvJRtSYwgolGyzOpCPaiaaSn0rah3OZS\n\t59clW7v3IAT26vNcA94DXVm4vvqQu1uA4wySwjystkBQpAjjSADVD0cYk2d6/MB5UT\n\t8U12In+0RpUCvQJRbVd8/waajNZntMJql1nH9cSrn05/mhcKFFbGD6LKUz5Ivzrv4N\n\tMkN8fnuroFym8MmWgDoIx2h2O87BCskV/+KeMY9Oiy1ObU4EhMn+TwZch1CPcQd3m5\n\tpHKqp9UkLoz9Q==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669995257;\n\tbh=1Zmi23CCq/9mIDPZHi23Sg8Jkyv95p+p5BlkjPy7VZc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LXMuaR0S7CPtJqWHXSo6q/mQ/Zf+M65YCyv9ftQ7rPXA5QwgUgqLyqD9nu8inzXQE\n\tAIQBgSamWoOubZ1p58GqkPpJ7n6hV4Sno9LI6ykJkp+VfeZzqZ8DuFX6iv2jEm1Iqq\n\tt8noZoFKRv5n3z2tsBcn3sn1azyQWqYnMgkUstKs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"LXMuaR0S\"; dkim-atps=neutral","Date":"Fri, 2 Dec 2022 17:34:15 +0200","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<Y4oa909bD7RBr82a@pendragon.ideasonboard.com>","References":"<20221202132706.15675-1-jacopo@jmondi.org>\n\t<Y4n+xJdFdyY1DHth@pendragon.ideasonboard.com>\n\t<20221202134827.feiigyswiay7gwgw@uno.localdomain>\n\t<Y4oEq3G0lFfbo1Xz@pendragon.ideasonboard.com>\n\t<20221202141521.dqmd4zx4i3vbghj2@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20221202141521.dqmd4zx4i3vbghj2@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25987,"web_url":"https://patchwork.libcamera.org/comment/25987/","msgid":"<20221202155914.qu667esw4iwia4yg@uno.localdomain>","date":"2022-12-02T15:59:14","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Fri, Dec 02, 2022 at 05:34:15PM +0200, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> On Fri, Dec 02, 2022 at 03:15:21PM +0100, Jacopo Mondi wrote:\n> > On Fri, Dec 02, 2022 at 03:59:07PM +0200, Laurent Pinchart wrote:\n> > > On Fri, Dec 02, 2022 at 02:48:27PM +0100, Jacopo Mondi wrote:\n> > > > Not really...\n> > > >\n> > > > I get with clang\n> > > >\n> > > > ../utils/ipu3/ipu3-unpack.c:21:63: error: passing argument 1 of ‘__xpg_basename’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]\n> > > >    21 |         printf(\"Usage: %s input-file output-file\\n\", basename(argv0));\n> > > >\n> > > > Sorry, I should have tested before, but it seemed trivial.\n> > > >\n> > > > I now wonder what 'basename' we were calling, or better, to which\n> > > > function prototype we were referring to, which didn't trigger such\n> > > > error...\n> > >\n> > > From libgen.h:\n> > >\n> > > /* Return final component of PATH.\n> > >\n> > >    This is the weird XPG version of this function.  It sometimes will\n> > >    modify its argument.  Therefore we normally use the GNU version (in\n> > >    <string.h>) and only if this header is included make the XPG\n> > >    version available under the real name.  */\n> > > extern char *__xpg_basename (char *__path) __THROW;\n> > > #define basename        __xpg_basename\n> > >\n> > > So we're using the string.h version. The basename manpage mentions\n> >\n> > Spot on, I read the header file after sending the email....\n> >\n> > >\n> > > NOTES\n> > >        There are two different versions of basename() - the POSIX version described above, and the GNU version, which one gets after\n> > >\n> > >                #define _GNU_SOURCE         /* See feature_test_macros(7) */\n> > >                #include <string.h>\n> > >\n> > >        The GNU version never modifies its argument, and returns the empty string when path has a trailing slash, and in particular also when it is \"/\".  There is  no  GNU  version  of\n> > >        dirname().\n> > >\n> > >        With glibc, one gets the POSIX version of basename() when <libgen.h> is included, and the GNU version otherwise.\n> > >\n> > > We have utils::basename() to support different libc versions, but we\n> > > can't use it in utils/. Have you encountered this when compiling for\n> > > Android ? Maybe we can disable compilation of those utilities instead ?\n> > >\n> >\n> > Yes, I am trying compile with the NDK.\n> >\n> > I think we can safely remove those scripts from the build (I wonder\n> > how this would be decided),\n>\n> Maybe a meson option ? Or doing so automatically based on a test at\n> configuration time to see if there's a compliant basename() ? Or even a\n> check on the platform type, if that's available.\n>\n\nWe could indeed have a build option to compile the several platform\nspecific utilities. I can list utils/ipu3 and utils/rkisp1 while\nutils/raspberry which contains CTT should probably be built\nunconditionally ?\n\n> > but I anticipate already that we'll have a\n> > few hickups as in example:\n> >\n> > ../src/libcamera/media_device.cpp:167:2: error: use of undeclared identifier 'lockf'\n> >         lockf(fd_.get(), F_ULOCK, 0);\n> >\n> > As Android has instead the BSD-conformant flock(). So expect more\n> > wrappers in utils::  (hopefully not many)\n>\n> We could skip the whole locking on Android, as there will never be\n> multiple processes trying to use the same camera. However, the lockf()\n> issue seems weird, it seems to be available in bionic.\n>\n\nOnly after API version 24 as far as I can tell, at least in NDK\n\n#if __ANDROID_API__ >= 24\nint lockf(int __fd, int __cmd, off_t __length) __RENAME_IF_FILE_OFFSET64(lockf64) __INTRODUCED_IN(24);\n\n/**\n * Like lockf() but allows using a 64-bit length\n * even from a 32-bit process without `__FILE_OFFSET_BITS=64`.\n */\nint lockf64(int __fd, int __cmd, off64_t __length) __INTRODUCED_IN(24);\n#endif /* __ANDROID_API__ >= 24 */\n\nI'll shortly send patches...\n\n> > > > On Fri, Dec 02, 2022 at 03:33:56PM +0200, Laurent Pinchart wrote:\n> > > > > Hi Jacopo,\n> > > > >\n> > > > > Thank you for the patch.\n> > > > >\n> > > > > On Fri, Dec 02, 2022 at 02:27:06PM +0100, Jacopo Mondi via libcamera-devel wrote:\n> > > > > > The \"basename\" function from the standard C library is defined in the\n> > > > > > libgen.h header.\n> > > > > >\n> > > > > > Include it to avoid errors triggered by -Wimplicit-function-declaration\n> > > > > >\n> > > > > > ../utils/ipu3/ipu3-pack.c:21:47: error: implicit declaration of function\n> > > > > > 'basename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]\n> > > > > >\n> > > > > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > > > >\n> > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > > >\n> > > > > > ---\n> > > > > >  utils/ipu3/ipu3-pack.c   | 1 +\n> > > > > >  utils/ipu3/ipu3-unpack.c | 1 +\n> > > > > >  2 files changed, 2 insertions(+)\n> > > > > >\n> > > > > > diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c\n> > > > > > index decbfc6c397a..27af44068956 100644\n> > > > > > --- a/utils/ipu3/ipu3-pack.c\n> > > > > > +++ b/utils/ipu3/ipu3-pack.c\n> > > > > > @@ -8,6 +8,7 @@\n> > > > > >\n> > > > > >  #include <errno.h>\n> > > > > >  #include <fcntl.h>\n> > > > > > +#include <libgen.h>\n> > > > > >  #include <stdint.h>\n> > > > > >  #include <stdio.h>\n> > > > > >  #include <string.h>\n> > > > > > diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c\n> > > > > > index 9d2c1200d932..aa67e0b0ecf5 100644\n> > > > > > --- a/utils/ipu3/ipu3-unpack.c\n> > > > > > +++ b/utils/ipu3/ipu3-unpack.c\n> > > > > > @@ -8,6 +8,7 @@\n> > > > > >\n> > > > > >  #include <errno.h>\n> > > > > >  #include <fcntl.h>\n> > > > > > +#include <libgen.h>\n> > > > > >  #include <stdint.h>\n> > > > > >  #include <stdio.h>\n> > > > > >  #include <string.h>\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 4A35EBE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Dec 2022 15:59:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B13116333F;\n\tFri,  2 Dec 2022 16:59:16 +0100 (CET)","from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B027060483\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Dec 2022 16:59:15 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 2639160006;\n\tFri,  2 Dec 2022 15:59:14 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669996756;\n\tbh=lbJzchTlubpZBpyRzZyENCD2u5yCo/m4bDujl12m9xM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=GemxjYwUxo9tNaXDQSyURljRe7QFFzqmPPEhxg2L1X/iv7oNs9aj8c87Zk6gy/gYC\n\trUJ7ztc4p+bhEYHgFmc1IBz6GzQtnXcr6f9kEz2RhlqqJnWxdvNoOvEzVbS/+TDaxJ\n\ts9HCUdl6hUpXfXgXqH7tdM7s4V8m05XMxq2vRMoktoj3BWvPOAfGuh3NcWiYJGSNpy\n\tRMMjPmScJdzKv4UoDXN4p/wWS8/rDO33nCtbvSL5EXwhXCBJ/T2AqutHDcRfhYWrIA\n\tSCzI+SzVJzMwtxM27+fnSvkPq5OLWBPea0pNoDCSTMPaRvGmoxEocJ0JKjZ6BRSQM+\n\tbK8+ZHdySMYow==","Date":"Fri, 2 Dec 2022 16:59:14 +0100","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20221202155914.qu667esw4iwia4yg@uno.localdomain>","References":"<20221202132706.15675-1-jacopo@jmondi.org>\n\t<Y4n+xJdFdyY1DHth@pendragon.ideasonboard.com>\n\t<20221202134827.feiigyswiay7gwgw@uno.localdomain>\n\t<Y4oEq3G0lFfbo1Xz@pendragon.ideasonboard.com>\n\t<20221202141521.dqmd4zx4i3vbghj2@uno.localdomain>\n\t<Y4oa909bD7RBr82a@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<Y4oa909bD7RBr82a@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25995,"web_url":"https://patchwork.libcamera.org/comment/25995/","msgid":"<Y4pkk7orhMORkCYv@pendragon.ideasonboard.com>","date":"2022-12-02T20:48:19","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Fri, Dec 02, 2022 at 04:59:14PM +0100, Jacopo Mondi wrote:\n> On Fri, Dec 02, 2022 at 05:34:15PM +0200, Laurent Pinchart wrote:\n> > On Fri, Dec 02, 2022 at 03:15:21PM +0100, Jacopo Mondi wrote:\n> > > On Fri, Dec 02, 2022 at 03:59:07PM +0200, Laurent Pinchart wrote:\n> > > > On Fri, Dec 02, 2022 at 02:48:27PM +0100, Jacopo Mondi wrote:\n> > > > > Not really...\n> > > > >\n> > > > > I get with clang\n> > > > >\n> > > > > ../utils/ipu3/ipu3-unpack.c:21:63: error: passing argument 1 of ‘__xpg_basename’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]\n> > > > >    21 |         printf(\"Usage: %s input-file output-file\\n\", basename(argv0));\n> > > > >\n> > > > > Sorry, I should have tested before, but it seemed trivial.\n> > > > >\n> > > > > I now wonder what 'basename' we were calling, or better, to which\n> > > > > function prototype we were referring to, which didn't trigger such\n> > > > > error...\n> > > >\n> > > > From libgen.h:\n> > > >\n> > > > /* Return final component of PATH.\n> > > >\n> > > >    This is the weird XPG version of this function.  It sometimes will\n> > > >    modify its argument.  Therefore we normally use the GNU version (in\n> > > >    <string.h>) and only if this header is included make the XPG\n> > > >    version available under the real name.  */\n> > > > extern char *__xpg_basename (char *__path) __THROW;\n> > > > #define basename        __xpg_basename\n> > > >\n> > > > So we're using the string.h version. The basename manpage mentions\n> > >\n> > > Spot on, I read the header file after sending the email....\n> > >\n> > > >\n> > > > NOTES\n> > > >        There are two different versions of basename() - the POSIX version described above, and the GNU version, which one gets after\n> > > >\n> > > >                #define _GNU_SOURCE         /* See feature_test_macros(7) */\n> > > >                #include <string.h>\n> > > >\n> > > >        The GNU version never modifies its argument, and returns the empty string when path has a trailing slash, and in particular also when it is \"/\".  There is  no  GNU  version  of\n> > > >        dirname().\n> > > >\n> > > >        With glibc, one gets the POSIX version of basename() when <libgen.h> is included, and the GNU version otherwise.\n> > > >\n> > > > We have utils::basename() to support different libc versions, but we\n> > > > can't use it in utils/. Have you encountered this when compiling for\n> > > > Android ? Maybe we can disable compilation of those utilities instead ?\n> > > >\n> > >\n> > > Yes, I am trying compile with the NDK.\n> > >\n> > > I think we can safely remove those scripts from the build (I wonder\n> > > how this would be decided),\n> >\n> > Maybe a meson option ? Or doing so automatically based on a test at\n> > configuration time to see if there's a compliant basename() ? Or even a\n> > check on the platform type, if that's available.\n> \n> We could indeed have a build option to compile the several platform\n> specific utilities. I can list utils/ipu3 and utils/rkisp1 while\n> utils/raspberry which contains CTT should probably be built\n> unconditionally ?\n\nI'd skip any C/C++ tools from utils completely on Android to be honest,\nI don't think any of them will be run on an Android device.\n\n> > > but I anticipate already that we'll have a\n> > > few hickups as in example:\n> > >\n> > > ../src/libcamera/media_device.cpp:167:2: error: use of undeclared identifier 'lockf'\n> > >         lockf(fd_.get(), F_ULOCK, 0);\n> > >\n> > > As Android has instead the BSD-conformant flock(). So expect more\n> > > wrappers in utils::  (hopefully not many)\n> >\n> > We could skip the whole locking on Android, as there will never be\n> > multiple processes trying to use the same camera. However, the lockf()\n> > issue seems weird, it seems to be available in bionic.\n> \n> Only after API version 24 as far as I can tell, at least in NDK\n> \n> #if __ANDROID_API__ >= 24\n> int lockf(int __fd, int __cmd, off_t __length) __RENAME_IF_FILE_OFFSET64(lockf64) __INTRODUCED_IN(24);\n> \n> /**\n>  * Like lockf() but allows using a 64-bit length\n>  * even from a 32-bit process without `__FILE_OFFSET_BITS=64`.\n>  */\n> int lockf64(int __fd, int __cmd, off64_t __length) __INTRODUCED_IN(24);\n> #endif /* __ANDROID_API__ >= 24 */\n> \n> I'll shortly send patches...\n> \n> > > > > On Fri, Dec 02, 2022 at 03:33:56PM +0200, Laurent Pinchart wrote:\n> > > > > > Hi Jacopo,\n> > > > > >\n> > > > > > Thank you for the patch.\n> > > > > >\n> > > > > > On Fri, Dec 02, 2022 at 02:27:06PM +0100, Jacopo Mondi via libcamera-devel wrote:\n> > > > > > > The \"basename\" function from the standard C library is defined in the\n> > > > > > > libgen.h header.\n> > > > > > >\n> > > > > > > Include it to avoid errors triggered by -Wimplicit-function-declaration\n> > > > > > >\n> > > > > > > ../utils/ipu3/ipu3-pack.c:21:47: error: implicit declaration of function\n> > > > > > > 'basename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]\n> > > > > > >\n> > > > > > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > > > > >\n> > > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > > > >\n> > > > > > > ---\n> > > > > > >  utils/ipu3/ipu3-pack.c   | 1 +\n> > > > > > >  utils/ipu3/ipu3-unpack.c | 1 +\n> > > > > > >  2 files changed, 2 insertions(+)\n> > > > > > >\n> > > > > > > diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c\n> > > > > > > index decbfc6c397a..27af44068956 100644\n> > > > > > > --- a/utils/ipu3/ipu3-pack.c\n> > > > > > > +++ b/utils/ipu3/ipu3-pack.c\n> > > > > > > @@ -8,6 +8,7 @@\n> > > > > > >\n> > > > > > >  #include <errno.h>\n> > > > > > >  #include <fcntl.h>\n> > > > > > > +#include <libgen.h>\n> > > > > > >  #include <stdint.h>\n> > > > > > >  #include <stdio.h>\n> > > > > > >  #include <string.h>\n> > > > > > > diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c\n> > > > > > > index 9d2c1200d932..aa67e0b0ecf5 100644\n> > > > > > > --- a/utils/ipu3/ipu3-unpack.c\n> > > > > > > +++ b/utils/ipu3/ipu3-unpack.c\n> > > > > > > @@ -8,6 +8,7 @@\n> > > > > > >\n> > > > > > >  #include <errno.h>\n> > > > > > >  #include <fcntl.h>\n> > > > > > > +#include <libgen.h>\n> > > > > > >  #include <stdint.h>\n> > > > > > >  #include <stdio.h>\n> > > > > > >  #include <string.h>","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 1DE01BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Dec 2022 20:48:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 898F96333F;\n\tFri,  2 Dec 2022 21:48:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 32F4C60483\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Dec 2022 21:48:22 +0100 (CET)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 96FF66E0;\n\tFri,  2 Dec 2022 21:48:21 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1670014103;\n\tbh=893zEzYyocOG/z2+brGiJ+EXicAWhRE7Zxxe+9OnDTE=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Upg72rkQzudCFznewRKNQeEwFzo5F+dHtPZUkfU3gBa/r/g0eKv6KXkUkvOSGfc/q\n\tXsKlHqODF5fwwG14WLcyU+UMH58nvGmPZN5E96h4BRGs1yyHyvJ5L+vsMI+eOIHCoR\n\tmgI7iTe6G0k8MIxgDKFexcEcS6gy4Cr2cNB6nPVU1HcGaaN/YC88uAQWpHMoJvNsYo\n\tO/kKLdi4mrrrL5weepmrCfMPR+FcqSMnVVPifly5X/75Zg5I8HUxPaawnXDuRRYmGe\n\tF+lT7dI+hQ9ciWt9CXakj3dCJ0+o/+Vr6p20gtxT6LiJqGy4TFMgMzkXmYGhBUID0w\n\tcPPTY9jwjYVvw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1670014101;\n\tbh=893zEzYyocOG/z2+brGiJ+EXicAWhRE7Zxxe+9OnDTE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=VIDucQ0Cd/yx2x2ROXOdXMw/HQyGIjtsi5QQnY0qQI2caEhGdZ56It3nr7rhYgyyM\n\tM2VrIahS2S5/RJ8hMDT4gCHJ2U8tng2Q4uj1cdhLKyI3NLE8LDczKOUCcsCDwgqGG1\n\ta6nBGCKvvd9IywOhHQ4oCQvJ0XGqTM7uUNVZmxsk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"VIDucQ0C\"; dkim-atps=neutral","Date":"Fri, 2 Dec 2022 22:48:19 +0200","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<Y4pkk7orhMORkCYv@pendragon.ideasonboard.com>","References":"<20221202132706.15675-1-jacopo@jmondi.org>\n\t<Y4n+xJdFdyY1DHth@pendragon.ideasonboard.com>\n\t<20221202134827.feiigyswiay7gwgw@uno.localdomain>\n\t<Y4oEq3G0lFfbo1Xz@pendragon.ideasonboard.com>\n\t<20221202141521.dqmd4zx4i3vbghj2@uno.localdomain>\n\t<Y4oa909bD7RBr82a@pendragon.ideasonboard.com>\n\t<20221202155914.qu667esw4iwia4yg@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20221202155914.qu667esw4iwia4yg@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Include libgen.h for\n\tbasename()","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]