This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] Setup: Fix erroneous quoting of __LINE__ and __FILE__
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Max Bowsher <maxb at ukf dot net>
- Cc: cygwin-apps at cygwin dot com
- Date: Sat, 12 Jul 2003 19:10:05 -0400 (EDT)
- Subject: Re: [PATCH] Setup: Fix erroneous quoting of __LINE__ and __FILE__
- Reply-to: cygwin-apps at cygwin dot com
On Sat, 12 Jul 2003, Max Bowsher wrote:
> Igor Pechtchanski wrote:
> > On Sat, 12 Jul 2003, Max Bowsher wrote:
> >>> 2003-07-11 Igor Pechtchanski <pechtcha@cs.nyu.edu>
> >>>
> >>> * String++.h (TOSTRING): New macro.
> >>> [snip]
> >>
> >> Do we need __TOSTRING__ and TOSTRING? Since they are defined in the same
> >> file, it isn't really making the namespace cleaner.
> >
> > Yes, we do need two macros. The helper macro (__TOSTRING__) can be named
> > something else, but it's needed to force parameter expansion. Otherwise,
> > TOSTRING(__LINE__) would have produced "__LINE__", not the stringified
> > value of __LINE__. This is straight from the K&R book...
>
> OK, I didn't know that. Would you add a comment on this subtlety?
Just did. If I'm not able to check it in once it's approved, I'll send
out an updated patch.
> > However, I just looked, and this kind of macro seems to be defined already
> > in /usr/include/symcat.h (XSTRING). I'm not sure whether it's better to
> > use the pre-existing macro, or to to define our own (with a more intuitive
> > name, IMO). The macro is simple enough. Opinions?
>
> IMO, define our own - more obvious name, plus symcat.h would really be a
> Cygwin header - My self-built gcc-mingw 3.3 doesn't search /usr/include. I
> don't know whether 3.2-3 does or not.
>
> Max.
That makes two of us. Let's see what Rob says.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton