This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Setup: Fix erroneous quoting of __LINE__ and __FILE__

On Sat, 12 Jul 2003, Max Bowsher wrote:

> Igor Pechtchanski wrote:
> > On Sat, 12 Jul 2003, Max Bowsher wrote:
> >>> 2003-07-11  Igor Pechtchanski  <>
> >>>
> >>> * 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.
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]