Talkback for article: 386, August2005
LF Tip: #defines for writing portable C-code
[ date: 2005-09-15 ]
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
[ date: 2005-09-23 ]
It was helpful.
From: shen yang <shen.yang888(at)gmail.com>
[ date: 2006-01-03 ]
From: Marty Leisner <leisner(at)rochester.rr.com>
[ date: 2006-02-02 ]
This approach is more flexible:
#define TTY_PORT "/dev/ttya"
#define TTY_PORT "/dev/ttyS0"
#error No tty port defined
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.:
From: Eric R
[ date: 2006-03-08 ]
This one also works
cpp -dM < /dev/null
but the one using echo is shorter.
[ date: 2006-04-15 ]
I hope someone would write an article regarding "hell of #defines".
Have a look at "openafs" source codes ;)
From: Arun <d.arun321(at)indiatimes.com>
[ date: 2006-05-17 ]
I dont understand why we need to change the timestamp of /tmp/foo.o
[ date: 2006-07-31 ]
"touch" does not modify the timestamp in this case. It just
creates an empty file
Due to the increased amount of web spam we have deciced to
removed the talkback posting possibility. You can read old talkbacks
but you can no longer post new ones.
Please contact webmaster(at)linuxfocus.org if you have any questions with regards to this talkback
lftalkback version 3.10