Assembler and Conditional Compilation (C Preprocessor)

Assembler and Conditional Compilation (C Preprocessor)

Post by Joerg Brueh » Wed, 18 Jun 2003 20:00:46



Dear readers,

I have a question about the "typical" (or "*") capabilities
of various C compilers:

- If I use the C compiler on C files ("xyz.c"), it first runs
  the C preprocessor to evaluate conditional compiling (and other)
  directives.
  So it is useful to pass "-Dsymbol" options to the compiler.

- I can also use the C compiler on assembler files ("xyz.s").

Now, will a C compiler (specific: "gcc" or the native ones of AIX,
HP-UX, Solaris, or Tru64) apply the preprocessing rules to
assembler sources as well?
In other words: Is there any use to pass "-Dsymbol" options to the
compiler when it operates on assembler files ("xyz.s")?

(I am _not_ looking for a way to do it, I rather ask myself whether
I will lose any useful functionality when I force our tool chain
to drop any "-Dsymbol" option in such a compiler call.)

Regards and TIA,
Joerg Bruehe

--
Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany
     (speaking only for himself)

 
 
 

1. Sys V/BSD "ps" newbie g++ preprocessor conditional compilation?

I'm writing a poriton of a program which needs to know what flavor of
unix is running so that it can properly format a "ps" command to be
used through "popen" depending on Sys V or BSD style PS.

In g++, is there a predefined preprocessor conditional I can test for
and use to conditionally compile the proper "ps" command?

If not, is there any reliable way to programmatically test for the
operating system and use the results to format the proper ps command?

If not, then, is there a reasonable way to approach this problem?

Thanks in advance!

remove "-" to "-" if replying via e-mail.

2. Browse IP OK, but name fails

3. Preprocessor for removing conditional code only?

4. X halts when I change the date???

5. how to stop compilation using CC preprocessor

6. Print server with Solaris 7

7. Conditional compilation

8. mounting e2fs

9. Conditional compilation in C?

10. conditional compilation

11. make & conditional compilation

12. make: conditional compilation/linking?

13. conditional compilation