This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author masamoto
Recipients benjamin.peterson, masamoto
Date 2015-04-26.19:51:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430077906.93.0.150080672686.issue24058@psf.upfronthosting.co.za>
In-reply-to
Content
I tried another two case changing variable declaration.
First case of just removing "extern", Compiler similarly warns, and test passed.
Second case of removing "_PyOS_ReadlineTState" declaration, Compiler has not warned, and test passed.

First:
$ hg diff
diff -r a50707a73d84 Modules/readline.c
--- a/Modules/readline.c	Wed Nov 05 15:11:34 2014 +0100
+++ b/Modules/readline.c	Mon Apr 27 03:09:06 2015 +0900
@@ -1062,7 +1062,7 @@
     rl_callback_handler_remove();
 }
 
-extern PyThreadState* _PyOS_ReadlineTState;
+PyThreadState* _PyOS_ReadlineTState;
 
 static char *
 readline_until_enter_or_signal(const char *prompt, int *signal)

$ ./configure --prefix=/opt/py34 && make
...
building 'readline' extension
...
/cygdrive/d/cyghome/masayuki/src/CPython-3.4/Modules/readline.c:1065:16: warning: '_PyOS_ReadlineTState' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 PyThreadState* _PyOS_ReadlineTState;
                ^
...

$ make install
$ /opt/py34/bin/python3.4m.exe -E -Wd -mtest -v test_readline
== CPython 3.4.3+ (3.4:a50707a73d84+, Apr 27 2015, 02:59:04) [GCC 4.9.2]
==   CYGWIN_NT-6.0-1.7.35-0.287-5-3-i686-32bit-WindowsPE little-endian
==   hash algorithm: siphash24 32bit
==   /tmp/test_python_3872
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_readline
testHistoryUpdates (test.test_readline.TestHistoryManipulation) ... ok
test_init (test.test_readline.TestReadline) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.203s

OK
1 test OK.


Second:
$ hg diff
diff -r a50707a73d84 Modules/readline.c
--- a/Modules/readline.c        Wed Nov 05 15:11:34 2014 +0100
+++ b/Modules/readline.c        Mon Apr 27 04:13:45 2015 +0900
@@ -1062,7 +1062,6 @@
     rl_callback_handler_remove();
 }

-extern PyThreadState* _PyOS_ReadlineTState;

 static char *
 readline_until_enter_or_signal(const char *prompt, int *signal)

$ ./configure --prefix=/opt/py34 && make
... building 'readline' extension has not warned.

$ make install
$ /opt/py34/bin/python3.4m.exe -E -Wd -mtest -v test_readline
== CPython 3.4.3+ (3.4:a50707a73d84+, Apr 27 2015, 04:19:36) [GCC 4.9.2]
==   CYGWIN_NT-6.0-1.7.35-0.287-5-3-i686-32bit-WindowsPE little-endian
==   hash algorithm: siphash24 32bit
==   /tmp/test_python_5936
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_readline
testHistoryUpdates (test.test_readline.TestHistoryManipulation) ... ok
test_init (test.test_readline.TestReadline) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.160s

OK
1 test OK.
History
Date User Action Args
2015-04-26 19:51:46masamotosetrecipients: + masamoto, benjamin.peterson
2015-04-26 19:51:46masamotosetmessageid: <1430077906.93.0.150080672686.issue24058@psf.upfronthosting.co.za>
2015-04-26 19:51:46masamotolinkissue24058 messages
2015-04-26 19:51:46masamotocreate