From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by sourceware.org (Postfix) with ESMTPS id 501E3385842D for ; Mon, 1 Nov 2021 12:34:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 501E3385842D Received: by mail-qt1-x829.google.com with SMTP id v4so1154041qtw.8 for ; Mon, 01 Nov 2021 05:34:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=Yztii/BJniA/44kOTPIGscazZyUX4YMlK91UezWFNug=; b=V4pI+YOnqs7E/KtrrVByDV0k7TuVEHYdDlL6uTyZYjM4iz+rWXPAL3RSvMKxjLGwiD akhTkcU+bb/8V8l1z/V0TfGJcaGIqQaCU4N+WydQ64QLPLiRP0bPihs8efK9iDWksBq7 xzqspqZv27X4VHbR11HzgX9mBvclpniuuchBFSW15UgKCRvTW2ALvEMkd56ygIYqjWC9 pmYdLenSWweM1d48KR/zwZqKPtLfQftv6jigryZdNlReG1h/+Bw0ClGm8KJVdPF6nHNS FGnuqoKLMg82Gruv7NRrnV4LJMt0Tuy+e1wBgN9pE0J0s2+hrmn8S3D/9Dv+DPaWUDEL b6XQ== X-Gm-Message-State: AOAM531x6d0PCbsoFrv4mk+J0nu0P9oTAusASR40VeRIF9s2RnZyjdbG bViiQYbdC+X6uJIgyQB+EGD1b/3FQ5Qi8A== X-Google-Smtp-Source: ABdhPJyOQwxDLfGP6Y/LnECijBnrvQAd5afETkgrMlWqeTeuI119nbTNGtMP3lVu+NMbVtB84mTm/w== X-Received: by 2002:ac8:57cb:: with SMTP id w11mr29665647qta.285.1635770046713; Mon, 01 Nov 2021 05:34:06 -0700 (PDT) Received: from ?IPV6:2804:431:c7cb:b64f:7c54:165f:8728:a193? ([2804:431:c7cb:b64f:7c54:165f:8728:a193]) by smtp.gmail.com with ESMTPSA id y14sm10447670qtw.68.2021.11.01.05.34.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Nov 2021 05:34:06 -0700 (PDT) Message-ID: <050a513c-03ce-9bab-126b-1855c2930fad@linaro.org> Date: Mon, 1 Nov 2021 09:34:04 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH] malloc_stats(): Fix `unsigned int` overflow Content-Language: en-US To: libc-alpha@sourceware.org References: From: Adhemerval Zanella In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2021 12:34:09 -0000 On 29/10/2021 21:36, Niklas Hambüchen via Libc-alpha wrote: > The error: > >> malloc.c:5169:48: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] > > glibc doesn't require C99, so I guess "%zu" is not an option, right? We build glibc with -std=gnu11, so we do require a compile that at least support C11. > > Since this is just in an `fprintf`, would casting to `(unsigned long long)` and using "%llu" be considered acceptable? Either way would be fine.