This is the mail archive of the cygwin-apps@cygwin.com 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__


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?

> 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.


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