Re: c preprocessor expansion

"Task Struct From Hell" <[email protected]>
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
On Thu, Jan 8, 2009 at 6:11 PM, ninjaboy <[email protected]> wrote:
> 2009/1/8 Task Struct From Hell <[email protected]>:
>> 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!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.