Re: good c compiler



jacob navia wrote, On 27/09/08 08:20:
lawrence.jones@xxxxxxxxxxx wrote:
jacob navia <jacob@xxxxxxxxxx> wrote:
MSVC users never use long double since it is the same as double,

And nobody ever uses long since it is the same as int on most platforms,
right?

And if they would use it, it will not port to lcc-win. As you know, long double
can be bigger than double.

My point was about compatibility between compilers on the same platform and that people need to be aware of where there are incompatibilities.

But can you point me to a header that is supposed to compile
under MSVC that uses long double? There is a lot of public domain
software that compiles under MSVC. Please find one.

It's C++ rather than C, but...
http://www.physionet.org/challenge/2006/sources/yuriy-chesnokov/lib.h

So there is your one example of someone providing a library including header file using long double. Of course finding such things is hard because of all the other stuff searches will throw up so I'm not going to search further.


MSVC stopped using long double since at least 10 years.

Still incorrect. It has long double it just uses the same representation as double. However, other people are complaining (with justification) that it does not use a higher precision long double.

Of course you can throw around ironic remarks like that as
long as you wish, together with your friends. Fact is,
MSVC doesn't even use long double.

Still incorrect. It supports long double, it just happens to use the same representation as double for it.

Anyway, the question was whether other people use long double in libraries that could be built with MSVC, and I've found one that is. There are valid reasons for doing this (making best use of the target platform) and these apply to closed source libraries as well as open source code.

I still say you have good reason for making long double higher precision. For all I know unlike with some other compilers you provide no compatibility with libraries built with MSVC, I just assumed your users might want to be able to use third-party pre-built libraries, since I know that I do, and in that case they need to be aware of any compatibility issues.

Other compiler vendors deliberately make themselves compatible with MSVC. If you choose not to that is up to you and does not affect your conformance to the C standard.
--
Flash Gordon
If spamming me sent it to smap@xxxxxxxxxxxxxxxxx
If emailing me use my reply-to address
See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
.



Relevant Pages

  • Re: good c compiler
    ... ABI for the platforms he is targeting. ... Same problem in reverse if the library is compiled with MSVC and the header refers to long double, although way round you can fix it by changing the header. ... Note that I'm NOT saying Jabob's decision is bad or unreasonable, just something the users of his compiler need to be aware of IF their code will be linked with code compiled with other compilers. ... I was not talking about libraries written BY MS, I was talking about libraries build USING MSVC. ...
    (comp.lang.c)
  • Re: good c compiler
    ... I was not talking about libraries written BY MS, I was talking about libraries build USING MSVC. ... I'll take your word on gcc. ... double is perfectly defensible but the restrictions it imposed on linking with code built with different compilers should be clearly stated. ...
    (comp.lang.c)
  • Re: How Are Libraries Programmed? With ASM?
    ... Cross compatibility with libraries tends to be based on the object ... try and use a C++ module with an assembler. ... modules are interchangable between c compilers and assemblers. ...
    (alt.lang.asm)
  • Re: C# Plugin system - same interface in two different assemblies...
    ... easy to see why the .NET designers went with the tried and true approach of just checking a unique identifier for each type. ... This is essentially what you achieve with COM by saying "yes, I implement this interface with this UID too", but then you want it by structural compatibility, not an agreed-upon UID. ... I'm not sure what you mean, as GCC, Intel, and Microsoft's compilers all produce compatible plugins for several products in our product suite. ... As long as you don't get subtle with multiple inheritance, method pointers or exceptions, those compilers will all produce the same low-level binary stuff to make sure it'll work with the other compilers. ...
    (microsoft.public.dotnet.languages.csharp)
  • switching mex compiler from lcc to MSVC - need a couple of tips!
    ... For compiling mex files, I want to switch from LCC to MSVC, because I want to ... I don't have MSVC++ 2005 v8 Pro package, but my needs are very simple and I ... I don't know about anything about resource compilers and manifest tools. ...
    (comp.soft-sys.matlab)