2005-09-15 -+- BarretJ -+- -+- why not just do this instead?

echo | cpp -dM

cpp defaults to reading standard input, so you don't really need to create an extra file -+- 24.193.246.69 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050910 Firefox/1.0.6 2005-09-23 -+- Senthil -+- -+- It was helpful.

-+- 143.166.255.17 = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4 2006-01-03 -+- shen yang -+- shen.yang888@gmail.com -+- nice going~ -+- 222.69.8.5 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) 2006-02-02 -+- Marty Leisner -+- leisner@rochester.rr.com -+- This approach is more flexible:

#ifdef sun
#define TTY_PORT "/dev/ttya"
#endif

#ifdef linux
#define TTY_PORT "/dev/ttyS0"
#endif

#ifndef TTY_PORT
#error No tty port defined
#endif

static char *port = TTY_PORT;


The advantages are:
You can define the TTY_PORT on the command line (maybe to port to a new system) -- i.e.:
-+- 13.13.16.2 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; XTM02b Beta 1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727) #2006-02-13 -+- nion -+- -+- ifdefs are crap write portable code with really different code files for different architectures or you will get unmaintable code in huge programs -+- 130.149.10.42 = Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 2006-03-08 -+- Eric R -+- -+- This one also works

cpp -dM < /dev/null

but the one using echo is shorter. -+- 200.104.54.88 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1 2006-04-15 -+- guest -+- -+- I hope someone would write an article regarding "hell of #defines".

Have a look at "openafs" source codes ;)

best regards. -+- 84.169.98.173 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7) 2006-05-17 -+- Arun -+- d.arun321@indiatimes.com -+- I dont understand why we need to change the timestamp of /tmp/foo.o -+- 203.91.201.4 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727) 2006-07-31 -+- James -+- -+- Hi Arun,
"touch" does not modify the timestamp in this case. It just
creates an empty file -+- 194.237.142.13 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4