From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 15B783858C74 for ; Sun, 20 Mar 2022 12:39:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 15B783858C74 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-ot1-x334.google.com with SMTP id d15-20020a05683018ef00b005b2304fdeecso8845432otf.1 for ; Sun, 20 Mar 2022 05:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:message-id:subject:references:in-reply-to :mime-version; bh=84Qj+few4qenJfFWOlArumJI6rQ8KNWtZ4SBdXBCUo4=; b=RqNvMBNT+72JuSbpSTp5fqQVDbY7UcLGkoKBtr8j4F/vUHT3ZNe6rs+DgfOceCvjN8 Ed7shi9eQBTnhlohT017vuRTCQufoZZ0YnvEtxVYDsmzIIQRzcRDAqD2aaZ1DLjBgEqf MkWUADyGYIO2wu76SeMsEmMvz6Cy95HKFBdl6Sg9jFQWz70pxcnyE8QxThlS0j+1MHst /TQ+TzYoaun+X193yhfdvFHFgFB78K+ZYakF9BBbsE8Xc5QNgGs09On+NVpVCsmXrTb9 WjPIQRTDm6mZFNeOLrZGaqM0LMZrohiIG34TscWysC0CHMSWQ/eQFsKQhA8Lk6n4Alm7 nKmQ== 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:cc:message-id:subject:references :in-reply-to:mime-version; bh=84Qj+few4qenJfFWOlArumJI6rQ8KNWtZ4SBdXBCUo4=; b=ZKNC0pVlCytJpGmY6JxMYvEyZ3T7o48JeYuPAjJGAavR564wUcv3eWwjo4kr0mbuZR TSPYJ2CidNRrSajm1Lq1MSA1T9loWFPp825wRC3IX3CcjN5iZbPiaGJIG1vbaJw/Yer1 hmnujJuXnuIT8GQmoulwMbEgXK0yBXoEQbmeuKrPZ3rgJRkgihGPcs63PLvq5V9MYTHu yjsEeZd0Wsc3PKsGr1m+0TWFGvNscb01u1tB5nbvSl3FKE5TRvF29SNdMVfCqWQght2G t/52Gd/7Nkt4un7tkutOsk8owNPav9uuy6f26vKM3wN9HSgiCrVwvA6FOGxANv5iR4CL +aNw== X-Gm-Message-State: AOAM533BtcpYfVExBEJWC3DnKre9oqcT+BxsHWW0GsWT3Hj5zL+D6Fh/ GF3RsGhcmd0/NVGfapKfh5eBGe6gkJkgTQ== X-Google-Smtp-Source: ABdhPJyQGzXs3dLIRuzyov2APKvuh5wPs6/8NfVXfjSMibozlg226GlIcn5m2a+ym6KxATRyube3lw== X-Received: by 2002:a9d:75cd:0:b0:5c9:61fa:3a42 with SMTP id c13-20020a9d75cd000000b005c961fa3a42mr6170900otl.15.1647779965741; Sun, 20 Mar 2022 05:39:25 -0700 (PDT) Received: from iPad ([2600:1700:e64:1440:380c:9332:6549:3042]) by smtp.gmail.com with ESMTPSA id v12-20020a056830140c00b005cb2f486230sm4920243otp.0.2022.03.20.05.39.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Mar 2022 05:39:25 -0700 (PDT) Date: Sun, 20 Mar 2022 07:39:24 -0500 From: Eric Bresie To: Mike Frysinger Cc: Richard Earnshaw , newlib@sourceware.org Message-ID: <2a049f53-52c8-4858-8075-e65a760d9875@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:39:31 -0000 Interesting was not familiar with either of these https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html Eric Bresie Ebresie@gmail.com (mailto:Ebresie@gmail.com) > On March 15, 2022 at 6:54:00 PM CDT, Mike Frysinger wrote: > On 15 Mar 2022 12:41, Richard Earnshaw wrote: > > On 15/03/2022 03:25, Mike Frysinger wrote: > > > __builtin_mul_overflow showed up with gcc-5, so stub it out for older > > > versions. > > > --- > > > newlib/libc/include/sys/cdefs.h | 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 > > > @@ -416,6 +416,10 @@ > > > #define __unreachable() ((void)0) > > > #endif > > > > > > +#if !__GNUC_PREREQ__(5, 0) > > > +#define __builtin_mul_overflow(a, b, size) ({ *(size) = (a) * (b); 0; }) > > > > Wouldn't > > (*(size) = (a) * (b), 0) > > > > be more portable (avoiding the GNU statement expression extension)? > > sure, that works too, thanks > -mike > signature.asc849 bytes (#attachment-1)