Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #55304 > unrolled thread
| Started by | Dave Angel <davea@davea.name> |
|---|---|
| First post | 2013-10-02 10:49 +0000 |
| Last post | 2013-10-02 10:49 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: PyDoc_STRVAR error in msvc compile Dave Angel <davea@davea.name> - 2013-10-02 10:49 +0000
| From | Dave Angel <davea@davea.name> |
|---|---|
| Date | 2013-10-02 10:49 +0000 |
| Subject | Re: PyDoc_STRVAR error in msvc compile |
| Message-ID | <mailman.609.1380711015.18130.python-list@python.org> |
On 2/10/2013 06:01, Robin Becker wrote: > On 02/10/2013 10:00, Robin Becker wrote: >> On 01/10/2013 18:26, MRAB wrote: >>> On 01/10/2013 17:41, Robin Becker wrote: >> .......... >>>> >>> I've tried it in a minimal console program, and it seems to work for me. >>> >> thanks for the test. I thought this might be an issue with the macro call >> argument being spread out over several lines, but since your try works I'll dig >> deeper. > I used -E to get the pre-processor output and it shows my string constant ends > up with the #ifdef inside it eg > > > ......\n" #ifdef ZZZZ " ZZZZ stuff\n" #endif "\n\.... > > I looked for any obvious reason why that should happen, but cannot find anything. > > if I remove the internal #ifdef and replace with a macro containing the > conditional string or "" then MSVC 9 seems to be ok with it. > MSVC and other compilers do not not see eye to eye on the preprocessor semantics. I no longer use MSVC so I can't experiment. I can only try to recall extensive manipulation two decades ago. I believe it does the logic of "backslash at the end of line" first. So if there are any spaces or tabs after those backslashes (which might have been lost when you pasted it here), fix them first. Then I think it looks for macro definitions, where the # must be the first non-whitespace of the line. Then it expands such macros, and I think MSVC is unusual in that it expands them multiple times, so a macro expansion can result in another macro invocation. I'm not sure where quotes fit in here. Your original message code doesn't match the expansion you show with -E, so i suspect your "..." eliding hid something significant. -- DaveA
Back to top | Article view | comp.lang.python
csiph-web