A
asit
what is the difference between portable C, posix C and windows C ???
what is the difference between portable C, posix C and windows C ???
user923005 said:Portable means that it will compile on many platforms.
To accomplish this, you need some kind of a standard.
The ANSI/ISO C standard creates one kind of portability for C
programs.
Posix is another kind of standard. It allows some additional
fascilities to be standardized that will not work without the Posix
assumption.
http://en.wikipedia.org/wiki/POSIX
There is no such thing as Windows C. There are C compilers that run
on Windows. Mingw GCC, Microsoft and Intel all make nice C compilers
for Windows.
HTH
Does portable C is as faster as posix C.
I mean to say that does portable C is converted directly to assembly
language....avoiding any intermediate conversion ???
Does portable C is as faster as posix C.
I mean to say that does portable C is converted directly to assembly
language....avoiding any intermediate conversion ???
asit said:what is the difference between portable C, posix C and windows C ???
Does portable C is as faster as posix C.
I mean to say that does portable C is converted directly to assembly
language....avoiding any intermediate conversion ???
asit wrote:
...
The advantage of portability is that the code can be compiled on many
different machines; it has nothing to do with speed. In some cases,
making code portable is incompatible with making it fast for a
particular platform, because it means that you can't use
platform-specific features that could achieve greater speed.
James Kuyper said:POSIX C code is C code that fully conforms to some version of the POSIX
standard. All of my code is POSIX C with that definition. You might
argue that it isn't truly a POSIX program unless it relies on at least
one POSIX-specific feature; I've only written a little bit of code that
qualifies as POSIX code, if you add in that requirement.
I don't write or read Windows C, so I don't feel competent to define it;
you might want to wait for a response from a Windows programmer. I would
presume that it means code which will work as intended when compiled and
executed on at least one Windows machine.
You might argue that it isn't
truly a Windows program unless it relies upon at least one
Windows-specific feature.
Malcolm said:Portable C depends only on the standard library.
Posix C depends on the Posix library, which is widely available on UNIX
systems but not generally on small systems.
But windows does provide its own library extensions.
POSIX is best be viewed as an extension to the C standard library, not
an extension to the language. So in the general case, there isn't a
performance difference. There are exceptions such as constraints
imposed by threading, but you shouldn't worry about those.
That depends on what you define as small. Posix is supported (or even
complied to) by a number of popular RTOS.
Erm no, if you want Posix on PC hardware, get (Open)Solaris.user923005 said:I guess the thing to do is get Linux if you really want Posix on PC
hardware.
Does portable C is as faster as posix C.
I mean to say that does portable C is converted directly to assembly
language....avoiding any intermediate conversion ???
I disagree on two counts, you may not need any compiler specificChris said:In message
Generally (but not always) portable C is slower because you don't use
the hardware or compiler specific extensions.
Ian Collins said:I disagree on two counts, you may not need any compiler specific
extensions and hardware specific extensions tend to be compiler options
rather than in the code. Compiler specific extensions tend to be
syntactic rather than performance enhancing.
That really depends how the hardware is mapped.Chris said:I have to completely disagree. In most of my work you could not get a
program to run without the extensions. How do you interface to the
hardware?
The only argument I have with this is that despite "ANSI-C" being
portable to a great number of computers and operating systems w/o
re-compiling what soever, one must take into account that it is still
not 100% portable, because of Micro Processors that have no monitors,
such that a printf() is pretty useless, nor file systems, making
fopen() kinda useless, etc...
On windows computers, what's to stop you from doing what many
programmers allready do? Create a .dll file for each CPU you want to
optimize for, then for eg. create a .dll file for each major video
card you need support for.
Ian Collins said:That really depends how the hardware is mapped.
what is the difference between portable C, posix C and windows C ???
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.