Compiler considerations

Hi this is rather basic question but to answer and understand the problem nedded expert.

compilers are OS dependent but OS may use any processor
how the compilers are able to generate code for different processors

just consider the below scenario:

 
Compilers:              dev c/VC++                 gcc                  turbo 
 
OS:                        windows                    linux                  DOS 
 
Processors:                              intel/motorola/AMD/celeron

any processor i can use for any system.

if we consider gcc, it can generate code for intel or motorola or AMD on some other OS.
how its achieving this.

what are the issues ( related to portability ) considered during the design of the compiler?

will they specify the set of processors that the compiler can generate the code for?

if so, they need to add the code for any newly invented processor.

Side node: gcc isn't restricted to Linux, but also available for Windows, using either MingW or Cygwin, as well as almost any other UNIX (HP-UX, *BSD, Solaris, ...).

Compilers are also MPU specific.

They most likely have a database of the instruction set of each mpu.

By knowing the instruction set of each mpu...easier for a software to remember but not for a programmer.

Yes they do.

Yes that would be called a newer version of the compiler.

can i print by any means(command or program) the set of processors that my compiler can generate code for?

i am using LINUX 2.4.20-8 smp on i386 machine

If you're using i386, it's time to upgrade. :wink: The basic i686 architecture has taken over for at least a decade now, covering the vast majority of the 32-bit world of processors. A lot of distros don't support i386 any more because that architecture is missing some important fundamental instructions now depended on for things like IPC.

Your compiler can probably generate code for x86 processors and nothing else. Most compilers aren't configured to generate code for anything except their native platform.

I dont know any command line options you can give to the compiler to figure out the supported mpus but the vendor from who you purchased it should be able to give you that information. So what compiler and version are you using.