From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id CB7203858C74 for ; Sun, 20 Mar 2022 12:52:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB7203858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-x236.google.com with SMTP id w127so13699275oig.10 for ; Sun, 20 Mar 2022 05:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:subject:references:in-reply-to:mime-version; bh=JsS0Mp9oRmtDSvUftODxAVZIljzfdksmVf0ZEAzjrHc=; b=XC1vE08SalYJ//wWd4zUKSyjveTS2/wtXzmuwDJqcWM+efQ3WmAG/oP5KUt5BquPRb opcioXsV01AxF5GP/Wh0b5WTfCg2/BYnqTDWx4IoP8u/RgEaPrMPECpbK1rzOvdJRtp2 zo1UW/567eUbZ2DzO+/k2c4rPLt7P8zCRsVucdIS6bRLttMfiXwnaPXH+O3qGfqk1KZM 6UPH9PwE2RrVCRrOkW7KWqNAAmRk3kqvt7rMiRIOpzQ0JxbAuKTvh/dvk4SZOZ2eXXvb CQeMBT1BoH1VGp680qquQoR0uGt6ssyXLicuQbANs6PmSwzIc/YAPAVb5z1TRotsmWzw 75fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:message-id:subject:references :in-reply-to:mime-version; bh=JsS0Mp9oRmtDSvUftODxAVZIljzfdksmVf0ZEAzjrHc=; b=jx8yD3zW/ZxpHWWx5pbzegYxy/vC+LXrLfpMF2guxXmZEvm8fFUqCnUxJczWGMpVc7 RWhYFWsh44xS+/Vttu3gne0o4u79cZgA6vwMyXZrDbK9/mDs/isa2wVm9uy9zMHkHdcM G4pbzxw6gTE/lZc4GVvIKQ8t48gln2YmSveqvpXPBU5RNxQlNKe0bh0Ej8SirbZTaPRX 1EFunPYHsiu5bR2/REjEUxIY0FAcu6qnFh89LJnFeP3E7aiRVYeUvc5qbe63J8JT5Q13 vebXVMygzNl3dSv3fdgessDcU9RS1TcxXHJORlL9xz16VDI55olcfxenFFMVLV3P/cir x21w== X-Gm-Message-State: AOAM533HTbvVsfD/tdjDPyDsTwWJiRfOxVRizcFqq8c4I+UvQbl/3JtT n+5E5NTOWWnewsc/eW7OCHwyN6K1pHuapA== X-Google-Smtp-Source: ABdhPJzkAW6aMVEcInjcnixWyZX7TtKDRf1bPmH+x+Cycn/KmXZAVNyQazPYHfMORBJE3pnoYd3I4Q== X-Received: by 2002:a05:6808:1a02:b0:2da:5cb7:1307 with SMTP id bk2-20020a0568081a0200b002da5cb71307mr12416951oib.238.1647780770523; Sun, 20 Mar 2022 05:52:50 -0700 (PDT) Received: from iPad ([2600:1700:e64:1440:380c:9332:6549:3042]) by smtp.gmail.com with ESMTPSA id z26-20020a9d62da000000b005b23f5488cdsm6048550otk.52.2022.03.20.05.52.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Mar 2022 05:52:50 -0700 (PDT) Date: Sun, 20 Mar 2022 07:52:49 -0500 From: Eric Bresie To: Newlib Message-ID: <6924e8ab-3322-4e4a-a9b1-1156a637a0a3@iPad> Subject: Re: Re: [PATCH v2] newlib: fix build with List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2022 12:52:53 -0000 My C is a little rusty so forgive me up front if I=E2=80=99m not reading = something quite right=E2=80=A6 Trying to understand the basic logic, the macro is expected to return Boo= lean but the expression is assigning the multiplication results to the si= ze and then always returning 0 (false). Is that flow correct=3F Should th= ere be some form of =E2=80=9C=3D=3D=E2=80=9C involved and/or ever return = non-zero number=3F Eric Bresie Ebresie=40gmail.com (mailto:Ebresie=40gmail.com) > On March 15, 2022 at 6:54:00 PM CDT, Mike =46rysinger wrote: > On 15 Mar 2022 12:41, Richard Earnshaw wrote: > > On 15/03/2022 03:25, Mike =46rysinger wrote: > > > =5F=5Fbuiltin=5Fmul=5Foverflow showed up with gcc-5, so stub it out= for older > > > versions. > > > --- > > > newlib/libc/include/sys/cdefs.h =7C 4 ++++ > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/= sys/cdefs.h > > > index da729092185c..e51f7f4b873a 100644 > > > --- a/newlib/libc/include/sys/cdefs.h > > > +++ b/newlib/libc/include/sys/cdefs.h > > > =40=40 -416,6 +416,10 =40=40 > > > =23define =5F=5Funreachable() ((void)0) > > > =23endif > > > > > > +=23if =21=5F=5FGNUC=5FPREREQ=5F=5F(5, 0) > > > +=23define =5F=5Fbuiltin=5Fmul=5Foverflow(a, b, size) (=7B *(size) = =3D (a) * (b); 0; =7D) > > > > Wouldn't > > (*(size) =3D (a) * (b), 0) > > > > be more portable (avoiding the GNU statement expression extension)=3F= > > sure, that works too, thanks > -mike > signature.asc849 bytes (=23attachment-1)