From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4B11044245 for ; Fri, 2 Sep 2022 22:12:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D5EBD68B960; Sat, 3 Sep 2022 01:12:32 +0300 (EEST) Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B380568B8FF for ; Sat, 3 Sep 2022 01:12:26 +0300 (EEST) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-3321c2a8d4cso28328117b3.5 for ; Fri, 02 Sep 2022 15:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date; bh=fXR8E+6EX9KcoHll0RBLhPBWVy5ZMZTQ4tZiw7hE3So=; b=l28wch3qfiRCVLmlCfMMTx+7YE6WGVx2CxsDHi1EAxAhRygxwHIP1BSJ5CISHcPsOq YGvsuP20tG8cPNFVyXPyY0nYBpd3Lpfv89xhi8l7ZQxmVOywrDyYGqjGSc5qJFSf9aKD 9j2zkYTPcfn2IENqMSl2ULf9pClub8wcP+DhdCwa+OL50/gbPZ4xXO0hydqlv6y76ICN mb/qecdvZkQ5b2pAYq6xjZP3+nmriA7wSM63Jeyua/P/bkV/HzieHRx48NFdmMA3RleB f9d4zab77VktKyoUaTe/ofT4RSLPMaKERE1rkd2IlMSZWjE/iWgjzHfuTCcBB++d0FXM LkJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=fXR8E+6EX9KcoHll0RBLhPBWVy5ZMZTQ4tZiw7hE3So=; b=tU25IQt4gBq6yEoeYUO2dVoW8aQJEqdOb1r4JAnVlUW5DB+m8eoGu3rtTcmbOB8GL9 mj7+/yV0tNC5a3BBkuiNIO6SBIDynwz7q1Ggqxqo7bFJOUWF084tpT6I4/Xgq/lBvJkY brUAEq+C2t0B/TOKQTQoII6wP+ra2Nt/SAqUom+SLLskOK5gSNm0iHGJI7G3wbR1bD42 TpRx2hEra6GKGpU3v85gAoFKeTM4P/YgbKy1EdnHKwiTN0IYnIBSPAB5PAXApmlQGlga O9MfbIepPD3aibIw9FVx2p0hQkmj5mw+4RoEtyAnbkl27vAj9ZXvQZU+Lr0Ywh4/3R/b ShiA== X-Gm-Message-State: ACgBeo2mkbZR6fMUaWGGlshpfEDEtdaMZpl7IaZuhUEoWOoqWCSByoMX d5KNfWYbjAa6JfKGHf7Rg9Nssl954Yj7tGKUlI9csqKpKSo= X-Google-Smtp-Source: AA6agR776Hmjod534l+KvXBiy3D1qn0YXM2jPiRxAHzT/EuIC61qHa/5+MQuJ38WlKe+5sZIxPHWdIDPSTZ4HtrMpWM= X-Received: by 2002:a0d:da07:0:b0:333:2cc6:6203 with SMTP id c7-20020a0dda07000000b003332cc66203mr29502869ywe.311.1662156745171; Fri, 02 Sep 2022 15:12:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Carl Eugen Hoyos Date: Sat, 3 Sep 2022 00:05:44 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH]lavf/hevc: Fix type specifiers X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Am Fr., 2. Sept. 2022 um 23:56 Uhr schrieb Andreas Rheinhardt : > > Carl Eugen Hoyos: > > Fixes several warnings: > > warning: format specifies type 'unsigned char' but the argument has type 'unsigned int' > > --- > > libavformat/hevc.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/libavformat/hevc.c b/libavformat/hevc.c > > index 1841dd5785..ca5187a92e 100644 > > --- a/libavformat/hevc.c > > +++ b/libavformat/hevc.c > > @@ -848,15 +848,15 @@ static int hvcc_write(AVIOContext *pb, HEVCDecoderConfigurationRecord *hvcc) > > if (array->numNalus == 0) > > continue; > > > > - av_log(NULL, AV_LOG_TRACE, "array_completeness[%"PRIu8"]: %"PRIu8"\n", > > + av_log(NULL, AV_LOG_TRACE, "array_completeness[%u]: %"PRIu8"\n", > > j, array->array_completeness); > > - av_log(NULL, AV_LOG_TRACE, "NAL_unit_type[%"PRIu8"]: %"PRIu8"\n", > > + av_log(NULL, AV_LOG_TRACE, "NAL_unit_type[%u]: %"PRIu8"\n", > > j, array->NAL_unit_type); > > - av_log(NULL, AV_LOG_TRACE, "numNalus[%"PRIu8"]: %"PRIu16"\n", > > + av_log(NULL, AV_LOG_TRACE, "numNalus[%u]: %"PRIu16"\n", > > j, array->numNalus); > > for (unsigned k = 0; k < array->numNalus; k++) > > av_log(NULL, AV_LOG_TRACE, > > - "nalUnitLength[%"PRIu8"][%"PRIu16"]: %"PRIu16"\n", > > + "nalUnitLength[%u][%u]: %"PRIu16"\n", > > j, k, array->nalUnitLength[k]); > > j++; > > } > > -- > > I didn't catch this, as I didn't get a warning at all. The reason for > this is that it is actually not problematic: > "The ellipsis notation in a function prototype declarator causes > argument type conversion to stop after the last declared parameter. The > default argument > promotions are performed on trailing arguments." The default argument > promotions include promoting integral types of conversion rank < int to > int. So av_log() has to read an int/unsigned even when one uses a > %"PRIu8". And so my inttypes.h contains this: > > # define PRIu8 "u" On Windows where clang shows a warning it is #define PRIu8 "hhu" See "Size Prefixes" in https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions > # define PRIu16 "u" > # define PRIu32 "u" > > No wonder neither GCC nor Clang warned about this. > Anyway, patch LGTM. Please push, I currently have no access to my development system. Thank you, Carl Eugen _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".