Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: sizeof Data types Date: Sat, 06 Aug 2016 18:10:23 -0700 Organization: None to speak of Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="29427"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+EdOJNEhKFgPM3QxjX3l6F" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:LQghua5D5/etBFt/VVlaiTxPoVg= sha1:eBKuJE2eJBSLqisHoaE7r0JE0F0= Xref: csiph.com comp.lang.c:91834 Nobody writes: > On Sat, 06 Aug 2016 21:43:45 +0100, BartC wrote: > >> long double (don't know) > > 8 or 10. > > 10 on Linux/x86, 8 on Windows or other architectures. I see 16 on Linux/x86-64. > Some versions of MinGW have a version of gcc which uses 10 in spite of the > fact that the standard library functions are provided by MSVCRT, which is > built with MSVC, which uses 8. Fortunately, the Windows API rarely (if > ever) uses "long double", but you have to watch out for e.g. printf("%Ld"). I think you mean "%Lf" (or "%Lg" or "%Le"). Incidentally, there's a workaround for MinGW's long double bug. If you define the macro __USE_MINGW_ANSI_STDIO as 1 before including , it will use its own implementation of printf rather than MSVCRT. (I don't know whether that also fixes problems with the long double math functions.) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"