Sorry, Ian, but I didn't understand your example. Look what I need: I'm developing a feature that sends gcov information coverage to a remote host, via sockets. So I would like the user to pass the host IP address via parameter during compilation. Something like: gcc file.c -ftest-coverage -fprofile-arcs -ipHost=127.0.0.1 where -ftest-coverage -fprofile-arcs are required in the use of gcov. And -ipHost is my new parameter. Thanks, Harry 2011/8/2 Ian Lance Taylor <iant@xxxxxxxxxx>: > Harry Trinta <harrytpc@xxxxxxxxx> writes: > >> I wonder how do I create a parameter in Gcc. >> For example, I want the user to pass a ip address in the compilation. >> I'll use this ip later. >> >> So the question is, how to record a new parameter in Gcc? > > Can you give a code example? > > Take a look at the -D option. It lets you write > > gcc -DADDR=127.0.0.1 foo.c > > and then in foo.c > > const char *s = ADDR; > > Ian >