* Re: c preprocessor expansion
2009-01-08 17:49 c preprocessor expansion Task Struct From Hell
@ 2009-01-08 17:46 ` Nicholas Mc Guire
2009-01-08 17:53 ` Yan Lin
2009-01-08 18:11 ` ninjaboy
2 siblings, 0 replies; 5+ messages in thread
From: Nicholas Mc Guire @ 2009-01-08 17:46 UTC (permalink / raw)
To: Task Struct From Hell; +Cc: linux-c-programming
>
>
> #define FOO "bar"
>
> int main() {
> printf(FOO);
> }
>
> It will output this:
>
> int main() {
> printf("bar");
> }
>
gcc -E file.c
hofrat@rtl14:~/stuff$ cat file.c
#define FOO "bar"
int main() {
printf(FOO);
}
hofrat@rtl14:~/stuff$ gcc -E file.c
# 1 "file.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "file.c"
int main() {
printf("bar");
}
hofrat
^ permalink raw reply [flat|nested] 5+ messages in thread
* c preprocessor expansion
@ 2009-01-08 17:49 Task Struct From Hell
2009-01-08 17:46 ` Nicholas Mc Guire
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Task Struct From Hell @ 2009-01-08 17:49 UTC (permalink / raw)
To: linux-c-programming
Hi,
I was wondering if gcc has any argument which allows for the expansion
of all macros in a file, just so if we have something like the
following:
#define FOO "bar"
int main() {
printf(FOO);
}
It will output this:
int main() {
printf("bar");
}
Thanks,
TSFH
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c preprocessor expansion
2009-01-08 17:49 c preprocessor expansion Task Struct From Hell
2009-01-08 17:46 ` Nicholas Mc Guire
@ 2009-01-08 17:53 ` Yan Lin
2009-01-08 18:11 ` ninjaboy
2 siblings, 0 replies; 5+ messages in thread
From: Yan Lin @ 2009-01-08 17:53 UTC (permalink / raw)
To: Task Struct From Hell, linux-c-programming
gcc -E would do this.
----- Original Message -----
From: "Task Struct From Hell" <taskstructfromhell@googlemail.com>
To: <linux-c-programming@vger.kernel.org>
Sent: Thursday, January 08, 2009 9:49 AM
Subject: c preprocessor expansion
> Hi,
>
> I was wondering if gcc has any argument which allows for the expansion
> of all macros in a file, just so if we have something like the
> following:
>
>
> #define FOO "bar"
>
> int main() {
> printf(FOO);
> }
>
> It will output this:
>
> int main() {
> printf("bar");
> }
>
> Thanks,
> TSFH
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
*** This email and any attachments thereto may contain private, confidential, and privileged material for the sole use of the intended recipient. Any review, copying, or distribution of this email (or any attachments thereto) by others is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto. ***
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c preprocessor expansion
2009-01-08 17:49 c preprocessor expansion Task Struct From Hell
2009-01-08 17:46 ` Nicholas Mc Guire
2009-01-08 17:53 ` Yan Lin
@ 2009-01-08 18:11 ` ninjaboy
2009-01-09 8:15 ` Task Struct From Hell
2 siblings, 1 reply; 5+ messages in thread
From: ninjaboy @ 2009-01-08 18:11 UTC (permalink / raw)
To: Task Struct From Hell; +Cc: linux-c-programming
2009/1/8 Task Struct From Hell <taskstructfromhell@googlemail.com>:
> Hi,
>
> I was wondering if gcc has any argument which allows for the expansion
> of all macros in a file, just so if we have something like the
> following:
>
>
> #define FOO "bar"
>
> int main() {
> printf(FOO);
> }
>
> It will output this:
>
> int main() {
> printf("bar");
> }
>
gcc -E code.c -o codemacro.m
--
noone is alone.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c preprocessor expansion
2009-01-08 18:11 ` ninjaboy
@ 2009-01-09 8:15 ` Task Struct From Hell
0 siblings, 0 replies; 5+ messages in thread
From: Task Struct From Hell @ 2009-01-09 8:15 UTC (permalink / raw)
To: ninjaboy; +Cc: linux-c-programming
On Thu, Jan 8, 2009 at 6:11 PM, ninjaboy <n0b0dyn1nj4@gmail.com> wrote:
> 2009/1/8 Task Struct From Hell <taskstructfromhell@googlemail.com>:
>> Hi,
>>
>> I was wondering if gcc has any argument which allows for the expansion
>> of all macros in a file, just so if we have something like the
>> following:
>>
>>
>> #define FOO "bar"
>>
>> int main() {
>> printf(FOO);
>> }
>>
>> It will output this:
>>
>> int main() {
>> printf("bar");
>> }
>>
>
> gcc -E code.c -o codemacro.m
Cheers for all responses so far!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-01-09 8:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-08 17:49 c preprocessor expansion Task Struct From Hell
2009-01-08 17:46 ` Nicholas Mc Guire
2009-01-08 17:53 ` Yan Lin
2009-01-08 18:11 ` ninjaboy
2009-01-09 8:15 ` Task Struct From Hell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).