Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp99186lqg; Fri, 26 Apr 2024 09:45:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVICeteCKq4TFySFHCcA92dzLJHjQRjC5Xt2o7Gr2K73hlhyg25IEi4mNXBkmpGu709wjDjSg0bvNkS6FWGTk15h7eMEDAYp9O9AivQ1w== X-Google-Smtp-Source: AGHT+IFGwa5To8iwIEX8Er1VHzpnzuSKyj56f4WqbK4BQ5NHF8L+rXzshm3EXXM9jGBHPtp3isKA X-Received: by 2002:a50:aacf:0:b0:570:1e15:a632 with SMTP id r15-20020a50aacf000000b005701e15a632mr2389205edc.27.1714149952172; Fri, 26 Apr 2024 09:45:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714149952; cv=pass; d=google.com; s=arc-20160816; b=bMpxfu850bylZS7J5g37U+2C5haYbSKTvPDLHp/GM6nTE+B6Pfv/ewIEk0xAX3RMt5 cvpmL2hR82/lPCtN+MyGm07MIkrvdnCxF7m1fh9Iep8RST5HkixeaHOxaikw8rTwUKBb z48g8wVCP5Dg0RbDJQCE86AId+4mdENXPZwSUr7ZGJe3vxFnon31n9fuODssr9NiHJoc gRKpAsyZGCVn7mJSoW7qbCToubK0Kdnjb0FmFxL7Rhgc45DC05sSqBsZFLQXAgSmlmrJ YU8yJgJEFJxx3CBABkpU+Nj3EIc6EZH7rBeas3S3Ye9l8MKXm5MFQTsuhPUskN7lqTTA 1/3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=5zvH51LJn1DaKEORzjaXXsEh34fzcWpP2cBJ3SlNta0=; fh=mmf8NNDa6/i3jZULXhyCFe0Lfve1RWi0tXUcS0mH26E=; b=WRUpRlecDVTXu482cJGQ1EDhgz1qj1uSjWkXFIfKk9Ok79aWDC+3T95Ahu7YudmHRY JBv8NMG65iDI1ziYq3zPycgYRxVSf5xil3VlsfsU7r5aB2N00RKVslqaI/ItXGx0kaoy zD8HmLIqQUtWDqLOf+RNF+ZFx8oD72b167kINUWKiGXtcb8BDf2XAPYoZaX4aanU1Bro SA9WcpihVruWuXi68nE03NYQaXZDGri0tZs3IrwwePLX27yyjcm4TFhV15R57Ud01SG3 cY9dG8W3UQdC1pB4ahEcNznXkBnb9mlZs7IsagdUt5UgA2z0ipiaFUuvCXfwpMgaAUFU TYdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sdfg.com.ar); spf=pass (google.com: domain of linux-kernel+bounces-160397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160397-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s20-20020aa7c554000000b0056bd9adc7b7si10893773edr.525.2024.04.26.09.45.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 09:45:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sdfg.com.ar); spf=pass (google.com: domain of linux-kernel+bounces-160397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160397-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D9E441F2409F for ; Fri, 26 Apr 2024 16:45:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2D0B152E1C; Fri, 26 Apr 2024 16:45:44 +0000 (UTC) Received: from alerce.blitiri.com.ar (alerce.blitiri.com.ar [49.12.208.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 099A82B9AF for ; Fri, 26 Apr 2024 16:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=49.12.208.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714149944; cv=none; b=bKEGWzRUP26axZKE5E3gb6sDCejJ77gYUPfYGFt/LlZA0svIwuQTiKrieTT7PcRZsOYBVdgZo875ZeQsj6/7iVSSdi17uAeJ4byReC6AXN18VbbjU7gnVvpZZUjP947Bx+JN0VfE/+4q1lO7yWSgng++XLfiWGZ+mE1udI7ml/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714149944; c=relaxed/simple; bh=hysiaFhfj1/CD6tXHxV36rXKGiuGpu+6Up+x096SWwQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=U1bEjoZqrONDhk8JRIIBIkyAKNBwXN+7umn2gsUXgpGTv7KtsJOobYSiPUrbOOAoFqySEjkLhnPXK+BwzKuCK6VqL4NRAaU8hgZXcC0ENHu/klI3gRLWlT6ETeQWWiVLKULf37HrhTdaq13KzuKzB4vaJG3D9oZM0OcM4reXg2U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sdfg.com.ar; spf=pass smtp.mailfrom=sdfg.com.ar; arc=none smtp.client-ip=49.12.208.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sdfg.com.ar Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sdfg.com.ar Received: from [IPV6:2a02:8109:aa26:4b00:1a1e:9a1e:44f7:a3cd] by sdfg.com.ar (chasquid) with ESMTPSA tls TLS_AES_128_GCM_SHA256 (over submission+TLS, TLS-1.3, envelope from "rodrigo@sdfg.com.ar") ; Fri, 26 Apr 2024 16:43:20 +0000 Message-ID: Date: Fri, 26 Apr 2024 17:43:19 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/4] selftests/nolibc: Add tests for strlcat() and strlcpy() To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Shuah Khan , "Paul E. McKenney" Cc: Willy Tarreau , linux-kernel@vger.kernel.org References: <20240218195110.1386840-1-rodrigo@sdfg.com.ar> <20240218195110.1386840-5-rodrigo@sdfg.com.ar> <172d25cf-cfd7-4069-8c26-df2e81ffbad1@t-8ch.de> Content-Language: en-US From: Rodrigo Campos In-Reply-To: <172d25cf-cfd7-4069-8c26-df2e81ffbad1@t-8ch.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/23/24 10:18 AM, Thomas Weißschuh wrote: >> +#define EXPECT_STRBUFEQ(cond, expr, buf, val, cmp) \ >> + do { if (!(cond)) result(llen, SKIPPED); else ret += expect_str_buf_eq(expr, buf, val, llen, cmp); } while (0) >> + >> +static __attribute__((unused)) >> +int expect_str_buf_eq(size_t expr, const char *buf, size_t val, int llen, const char *cmp) >> +{ >> + llen += printf(" = %lu <%s> ", expr, buf); > > This introduces a compiler warning on 32bit: > > i386-linux-gcc -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra -fno-stack-protector -m32 -mstack-protector-guard=global -fstack-protector-all -o nolibc-test \ > -nostdlib -nostdinc -static -Isysroot/i386/include nolibc-test.c nolibc-test-linkage.c -lgcc > nolibc-test.c: In function 'expect_str_buf_eq': > nolibc-test.c:610:30: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] > 610 | llen += printf(" = %lu <%s> ", expr, buf); > | ~~^ ~~~~ > | | | > | | size_t {aka unsigned int} > | long unsigned int > | %u > > > It is easy enough to fix through a cast to "unsigned long". Thanks for fixing it! Of course, don't hesitate to let me know if there is something I can help with :) Best, Rodrigo