M
max(01)*
hi.
i want to examine preprocessed source which only has certain macros
expanded, for example i would like to have:
#include <stdio.h>
#include "other.c"
int main() {
...
}
tranformed into:
#include <stdio.h>
<insert here the result of other.c inclusion>
int main() {
...
}
so that #include <stdio.h> is not expanded... in general i would like to
have standard library header macros not expanded...
up to now i only have come up with smt like this:
#ifdef INCLUDE_STDIO
#include <stdio.h>
#endif
#include "other.c"
int main() {
...
}
so that i compile using:
$ cc -DINCLUDE_STDIO source.c
*or* i can examine preprocessed source using:
$ cc -E -P source.c
[note: this is gcc specific, but i think it is clear anyway: -D option
defines a macro, -E option does preprocessing only, -P "cleans up"
output a bit]
any simpler/better/moregeneral/morestandard/moretested method?
bye
max
i want to examine preprocessed source which only has certain macros
expanded, for example i would like to have:
#include <stdio.h>
#include "other.c"
int main() {
...
}
tranformed into:
#include <stdio.h>
<insert here the result of other.c inclusion>
int main() {
...
}
so that #include <stdio.h> is not expanded... in general i would like to
have standard library header macros not expanded...
up to now i only have come up with smt like this:
#ifdef INCLUDE_STDIO
#include <stdio.h>
#endif
#include "other.c"
int main() {
...
}
so that i compile using:
$ cc -DINCLUDE_STDIO source.c
*or* i can examine preprocessed source using:
$ cc -E -P source.c
[note: this is gcc specific, but i think it is clear anyway: -D option
defines a macro, -E option does preprocessing only, -P "cleans up"
output a bit]
any simpler/better/moregeneral/morestandard/moretested method?
bye
max