Many lines from a macro?

Peter Wentworth cspw at quagga.ru.ac.za
Wed Jan 23 07:17:02 AEST 1991


Can a C macro replacement ever result in more than one output line from
the preprocessing stage?

I am using the SUN assembler which first uses the C preprocessor.
The C macro

#define FOO       jmp label;\
                  nop;\
              label:

expands to this output:       jmp label;  nop;  label:

But the assembler insists that the label starts on a new line,
so this is not acceptable.  Is there some magic that will 
yield three separate lines of macro output, instead of one?

I don't think this can ever cause problems in C, but I suspect
there other languages that would benefit from using a general
standardized C preprocessor as a front end.  Was there ever any
notion among the ANSI committee that things like preprocessing
features could be included on grounds of 'general usefulness',
rather than 'useful only to C'?

Pete 

-- 
EP Wentworth - Dept. of Computer Science - Rhodes University - Grahamstown.
cspw at quagga.ru.ac.za  
  (If that fails, try cspw.quagga at f4.n494.z5.fidonet.org)



More information about the Comp.lang.c mailing list