From patchwork Sat Nov 24 21:02:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Harris X-Patchwork-Id: 11148 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 5A9EB44D0E4 for ; Sat, 24 Nov 2018 23:10:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CBA3868A1CC; Sat, 24 Nov 2018 23:10:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E62C168015B for ; Sat, 24 Nov 2018 23:10:44 +0200 (EET) Received: by mail-pl1-f193.google.com with SMTP id b22-v6so12035715pls.7 for ; Sat, 24 Nov 2018 13:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IbDu/11GWHYxFFp7T1JRH0LwCvpbIR3k6dK9EJD0r3A=; b=smMDKX5Hs5XfW64X9C+nUMpT2y9Y93wZg6Evg+zf2iWD8AEwhwY0NLq1ppxQe3Rfyu VCiOQk5GKpH05SOKznFTezz3Oe9eqp2Kf35kzezNZ3x4iu203Vt+380Aly9gxDlc+H43 3i9G6N6CvEKGDemnUtlgDnHBqVT9RDutmr4EIfrzWK88pL0btVzBbvUhdAJ9PpbMTKeL HKr+q2dTpUr2Hkwsn6W2EFggtkEtGprDqX7C4bLFNgbhwzz8nlH/IS2o0R7rcMIKRxZe h7lGjQhQPZ9vN3tuz5hh/7mcCuaLnLlL6xO17SsRk3lQOoOJpTefkuPpwDfpKb1hESUB 0pGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=IbDu/11GWHYxFFp7T1JRH0LwCvpbIR3k6dK9EJD0r3A=; b=IMQMO26EshwTrK6XJaSOgul9vW/zJKGNB9CecjgcuJXIeemFVENsdFm22JrOltulDx aPXtRtMlW7qsuHG9FBwGQu6jCqsGjy2MCitx3eZPgO+7jRa96CxsVAde/6bTTFCQhlYW 0+Wh/5lV36m5dJqpRoLP8vamodEDpGCqY+QUR+pcY7eDoXT76lQfavSqIof79HTEpt8R i8gpQiaB+C5adFEOrgFQ1+2ZBgeQC+TJY45QAZdNLb9Qw9mvrZFKfy5YCXUZTWmNfNvi yVDqVjWxq8yCDQHnGeGvpjKCdFALSx5w8YwGBL1Wl5bkrPO3TwgRGL9ICv4iHBdwkMgD +pzA== X-Gm-Message-State: AA+aEWZs8S55mAw1vUEGp4d0DS54mL5LnzN4g8FTRy4lOn+q5znFCh3p zNdgX+TQ6K4/12a7Fa0LnWixcKRa X-Google-Smtp-Source: AFSGD/UwKFiKDAf65+ujP5/wOQ3o85LK8QgF/BhEZS/SmFObGUhjqKfm5EjMCgT2pQnSIyyjwAAc6w== X-Received: by 2002:a17:902:aa84:: with SMTP id d4-v6mr21499673plr.25.1543093384934; Sat, 24 Nov 2018 13:03:04 -0800 (PST) Received: from kira.gmail.com ([2601:646:9500:53f1:1d5c:1184:2d86:c057]) by smtp.gmail.com with ESMTPSA id r80sm3716750pfa.111.2018.11.24.13.03.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Nov 2018 13:03:04 -0800 (PST) From: Mark Harris To: ffmpeg-devel@ffmpeg.org Date: Sat, 24 Nov 2018 13:02:02 -0800 Message-Id: <20181124210202.52207-1-mark.hsj@gmail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avutil/mem: Fix invalid use of av_alloc_size X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Mark Harris Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The alloc_size attribute is valid only on functions that return a pointer. GCC 9 (not yet released) warns about invalid usage: ./libavutil/mem.h:342:1: warning: 'alloc_size' attribute ignored on a function returning int' [-Wattributes] 342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); | ^~~~~~~~~~~~~ --- libavutil/mem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/mem.h b/libavutil/mem.h index 55ae573ac9..5fb1a02dd9 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -339,7 +339,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size) * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be * correctly aligned. */ -av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); +int av_reallocp_array(void *ptr, size_t nmemb, size_t size); /** * Reallocate the given buffer if it is not large enough, otherwise do nothing.