Compiler == Machine-independent?

L

lovecreatesbea...

Does the ability of making a C compiler on a particular machine mean
the machine-independent of C computer language on this kind of machine?
 
W

Walter Roberson

Does the ability of making a C compiler on a particular machine mean
the machine-independent of C computer language on this kind of machine?

No. There are quite a number of parts of C that are implementation
specified. To take one example, the behaviour of right-shifting
a negative value is up to the implementation; another example
is that the size (and range) of 'int' can vary between machines.

Experienced programmers know where the dirty laundry is, and
write so that their program will work on all systems their code
is likely to be ported to. (Sometimes it just isn't worth
writing 100% portable code, if the chance that the code will
be taken to a very unusual machine is essentially none.)
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top