From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id 82BAD3857352 for ; Wed, 8 Feb 2023 11:11:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 82BAD3857352 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-ed1-x531.google.com with SMTP id v10so19914732edi.8 for ; Wed, 08 Feb 2023 03:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=i0XsdZxU0aC8xV+rUA9grI4Xzfw0LIRSzzXo2sh0LG8=; b=ICOVOoU2Nv0wXAkN+VQpRHMCAEimSF6EARSPKqNXGgQdCjR4h2wxoS/sSYzkWGUtLO tp1SR8cZrfov1+R96yQjZ95TGfC/g/hO2NLnIO20EzFsmafEvjFzRY9Vd+M9US3Nm1Zu m0xrtTbzl/QN/JKLTBRPoSya5eRyBoV8WDaIyHYPCC8TvZrz5kr6EI3KD9jOjnbb8TVZ 1MK2HzP9ZNVvv+HtRyFzu5HibRztKprjvpj9vPoekYTBCDRzK9gMjk9MSuZVYTMI0HUc x5vn2CJHCUkZqaYCqtXPxL5tLyNHSCA0wPhB3dxs5/zhKWCnJyIX6n6F4IdUjTxZVdGn SB2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i0XsdZxU0aC8xV+rUA9grI4Xzfw0LIRSzzXo2sh0LG8=; b=sDrgpl13jxMTqYQgfTcDXHm4og8BVe7OaYDzyzye0X69mAjQnFxlJGwLgkdcnn3CB6 pMPmW7AHoqCSrN6tsfJSCjTWXqFnzEY0jMqmlcRZeq5F31Vk4iut5liIB7fafhwht5WI 8M2yXq2Gi8fjtcklFUCAwvDEDr3gyK9W2McQ40tgyT1vXVG6m0zgOokoJhy97Na2Kb1P 2Xzv1C/uI/5FyW05rUDRfYEf/CFkViTpapzXJVN/jW75zsNt5qgu+3Mz5zgnDgJ3rVvv eJEKTQxWRTg/HsjBVAPpv5rfoPropo7C3QfKuN0eamxQTrKmXmpNn04CfYKwGYd08LMw 0pwQ== X-Gm-Message-State: AO0yUKXbQxGEHwh16T8ceETJawWZ8nwA21bhVpVjCQT1YdhwQKP4CcwV CtSaiOnNv1FcWX9+qqSV51UPyEHGzGdxQgwDuPA= X-Google-Smtp-Source: AK7set/Km4Xy6zGbPnlrdH+NIETj+9tDwWA8BLvKB9NB2U5GT5O3oBv9Dh3GfwPO5oAL+szaGTVqJ2VOOrh4F+vJ4QQ= X-Received: by 2002:a50:f689:0:b0:4a3:fc00:9d69 with SMTP id d9-20020a50f689000000b004a3fc009d69mr1569047edn.6.1675854705290; Wed, 08 Feb 2023 03:11:45 -0800 (PST) MIME-Version: 1.0 References: <1675846132.6232748@f313.i.mail.ru> In-Reply-To: <1675846132.6232748@f313.i.mail.ru> From: Jonathan Wakely Date: Wed, 8 Feb 2023 11:11:34 +0000 Message-ID: Subject: Re: Bytes of long double - trouble . . . To: Sergey Smith Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 8 Feb 2023 at 08:50, Sergey Smith wrote: > > > To: gcc-help@gcc.gnu.org > Dear GCC, [ 8:2:23 ] > Like Woooew ! What is THIS!? I installed Visual Studio= Code, & your 32 bit C, Version 9.2.0. I ran : What is "C"? That's not a compiler, what did you actually install? How are you running it? We can't help you with such vague, unclear descriptions of your question. > printf("\nOn THIS particular computer, long double is given %d bytes\n= ", sizeof(long double)); /* The Answer was: 12 bytes. > THEN, I updated to C Version 12.2.0 and ran the same code, - ON THE SA= ME COMPUTER, - but NOW the answer is: 16 bytes ! > > HOW can this happen if, as I understand it, - this function is suppos= ed to assess a computer=E2=80=99s *hardware* ? I am on Windows 10 btw. No, 'long double' is a C language type. The hardware has registers that might be 32 bits, 64 bits, 80 bits or 128 bits wide. The 'long double' type is implemented in the compiler to use the hardware in an implementation defined way. The most likely explanation is that your first program was compiled as a 32-bit i686 program, where long double is 12 bytes, and your second program was compiled as a 64-bit x86-64 program, where long double has an extra 4 bytes of padding.