Zachary Ware added the comment:
With two-pass gone, this is gone.
--
resolution: remind -> out of date
stage: patch review -> resolved
status: open -> closed
___
Python tracker
Serhiy Storchaka added the comment:
The file preset is default now, but if you will consider Argument Clinic as
general tool for use in third-party software, the bug still is here.
--
priority: normal - low
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - remind
versions: +Python 3.6 -Python 3.4, Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
Serhiy Storchaka added the comment:
Ah, if the two-pass preset is gone, then of course the bug is gone too.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
Larry Hastings added the comment:
I thought the bug only happened with the two-pass preset. The two-pass
preset is gone, because I broke it, and nobody was using it anyway, so I
removed it.
(I don't even remember what two-pass was trying to do. It's possible the
same effect could be
Larry Hastings added the comment:
Is this problem gone, now that Serhiy changed everything over to the file
preset?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
components: +Argument Clinic
nosy: +steve.dower, tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
Zachary Ware added the comment:
That may be for the best.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
___
Python-bugs-list mailing
Larry Hastings added the comment:
Perhaps, now that Guido allows us to redirect into a separate file, we should
simply abandon the two-pass approach.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
Steve Dower added the comment:
Not sure how helpful this is, but the following code compiles fine for me (VC
12.0 and 14.0):
#include stdio.h
char myStr[];
struct { char* a; } myStruct = { myStr };
int main() {
printf(%s, myStruct.a);
return 0;
}
static char myStr[] = 123456789;
Serhiy Storchaka added the comment:
What if add const in PyDoc_VAR?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
___
Steve Dower added the comment:
You need to leave static out of the forward definition and then add it in the
initialization. The variable is not accessible from other object files - I
checked.
const char[] and static const char[] should work the same, though I haven't
tried it.
--
Zachary Ware added the comment:
(My last comment was aimed at Larry's comment about abandoning two-pass...)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
Serhiy Storchaka added the comment:
You forgot static in the declaration Steve.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
___
Zachary Ware added the comment:
You're right, of course; I don't know how I got a non-screwball result in prior
testing. Here's an updated patch.
I have not come up with any better alternative.
--
stage: - patch review
Added file: http://bugs.python.org/file36259/issue20323.v2.diff
Changes by Mark Lawrence breamore...@yahoo.co.uk:
--
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
___
Zachary Ware added the comment:
Larry Hastings wrote:
Does your proposed solution work properly when docstrings are turned
off? Try undefining WITH_DOC_STRINGS. I bet you need to make the
size 1 in that case.
For certain values of properly, yes. It builds with no warnings or errors on
Larry Hastings added the comment:
If in C you define
static char a[5] = abcde
C suppresses the trailing '\0'. That it continued to work okay was a lucky
break--you must not have looked in many docstrings, or you lucked out and they
happened to be padded with zeroes.
--
Larry Hastings added the comment:
I had to throw it in a struct to prevent gcc from rearranging the variables.
But this demonstrates the problem--when it prints the string, it doesn't stop
at the end.
-
#include stdio.h
typedef struct
{
int a;
char b[8];
int c;
}
New submission from Zachary Ware:
The current two-pass output for the two-pass preset causes compile errors on
Windows. A sample:
..\PC\winsound.c(71): error C2133: 'winsound_PlaySound__doc__' : unknown size
Line 71 (clinic-generated docstring_prototype):
Changes by Zachary Ware zachary.w...@gmail.com:
--
components: +Build, Demos and Tools, Windows
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
___
Larry Hastings added the comment:
I don't understand the problem--you didn't give me enough context. Can you
attach a file that demonstrates the problem?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20323
Zachary Ware added the comment:
Attached is PC/winsound.c, as converted in issue20172, but using the two-pass
preset output scheme.
Compiling with this file produces these errors:
..\PC\winsound.c(71): error C2133: 'winsound_PlaySound__doc__' : unknown size
Larry Hastings added the comment:
Does your proposed solution work properly when docstrings are turned off? Try
undefining WITH_DOC_STRINGS. I bet you need to make the size 1 in that case.
Also, the length must be len(f.docstring) + 1, to account for the trailing \0.
Also, error C2133
Serhiy Storchaka added the comment:
Why PyDoc_VAR prototype is used at all? There are only two occurrences of
PyDoc_VAR in current code, and one of them actually can be replaced by
PyDoc_STRVAR.
--
nosy: +serhiy.storchaka
___
Python tracker
Larry Hastings added the comment:
Serhiy: PyDoc_VAR is used in the two-pass approach as a forward declaration
for docstrings. Imagine if, in winsound.c, sound_methods was defined above the
dump buffer block. The expansion of WINSOUND_PLAYSOUND_METHODDEF would
include a reference to
26 matches
Mail list logo