Re: [Python-Dev] Fix strncpy warning with gcc 8 (#5840)

2018-03-06 Thread Serhiy Storchaka

06.03.18 12:34, Xiang Zhang пише:

https://github.com/python/cpython/commit/efd2bac1564f8141a4eab1bf8779b412974b8d69
commit: efd2bac1564f8141a4eab1bf8779b412974b8d69
branch: master
author: Siddhesh Poyarekar 
committer: Xiang Zhang 
date: 2018-03-06T18:34:35+08:00
summary:

Fix strncpy warning with gcc 8 (#5840)

The length in strncpy is one char too short and as a result it leads
to a build warning with gcc 8.  Comment out the strncpy since the
interpreter aborts immediately after anyway.

files:
M Python/pystrtod.c

diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index 9bf936386210..601f7c691edf 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -1060,8 +1060,8 @@ format_float_short(double d, char format_code,
  else {
  /* shouldn't get here: Gay's code should always return
 something starting with a digit, an 'I',  or 'N' */
-strncpy(p, "ERR", 3);
-/* p += 3; */
+/* strncpy(p, "ERR", 3);
+   p += 3; */
  Py_UNREACHABLE();
  }
  goto exit;



I think this code was added for purpose. In the case of programming 
error we could get meaningful value in post-mortal debugging. But after 
replacing assert(0) with Py_UNREACHABLE this perhaps lost a sense.


If this code is no longer needed it is better to remove it than keeping 
an obscure comment.


What are your thoughts @warsaw and @ericvsmith?

Py_UNREACHABLE was added in issue31338 by Barry. The original code was 
added in issue1580 by Eric Smith (maybe it was copied from other place).


___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Any way to only receive emails for threads that I am participating in?

2018-03-06 Thread Elias Zamaria
Matěj, thanks for the suggestion. I haven't used Usenet in over a decade. I
may try using a Usenet reader if I feel like trying something new (actually
very old, but kind of unfamiliar to me from being not fresh in my head),
but for now, I'm going to use Gmail's filtering so I can prevent the
python-dev messages from being mixed with the other stuff in my inbox. If
that is somehow not good enough for me, after taking a few days or weeks to
get used to it, then I will try other ways of dealing with it.

On Mon, Mar 5, 2018 at 10:08 PM, Matěj Cepl  wrote:

> On 2018-03-03, 02:15 GMT, Elias Zamaria wrote:
> > It seems like I can either subscribe and get emails for all of
> > the threads, or unsubscribe and not get any emails, making me
> > unable to reply to the threads I want to reply to.
>
> Go to https://mail.python.org/mailman/listinfo/python-dev in the
> last input box fill in your email, and click on [Unsubscribe or
> edit options]. On the next page fill-in your password (you get
> it every month in email), and on the settings page switch “Mail
> delivery” to “Disabled”.
>
> You will not get any message from the list, but you will be
> still subscribed, so you can post to the list.
>
> Then open your NNTP newsreader
> (https://en.wikipedia.org/wiki/Newsreader_(Usenet)) (you use
> one, right? It is the only sensible way how to deal with the
> large community lists) and subscribe to
> nntp://news.gmane.org/gmane.comp.python.devel . You will have
> all advantages of newsreader (killfile, easy ignoring whole
> threads at once) in the comfort of your computer, perhaps even
> in the offline state.
>
> If you don’t want to go all that length, just use email program
> which can kill threads (e.g., Thunderbird
> https://support.mozilla.org/en-US/kb/ignore-threads )
>
> Best,
>
> Matěj
> --
> https://matej.ceplovi.cz/blog/, Jabber: [email protected]
> GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
>
> Of all tyrannies, a tyranny exercised for the good of its
> victims may be the most oppressive. It may be better to live
> under robber barons than under omnipotent moral busybodies. The
> robber baron's cruelty may sometimes sleep, his cupidity may at
> some point be satiated; but those who torment us for our own
> good will torment us without end, for they do so with the
> approval of their consciences.
> -- C. S. Lewis
>
> ___
> Python-Dev mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
> mikez302%40gmail.com
>
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Fix strncpy warning with gcc 8 (#5840)

2018-03-06 Thread Eric V. Smith

On 3/6/2018 6:52 AM, Serhiy Storchaka wrote:

06.03.18 12:34, Xiang Zhang пише:
https://github.com/python/cpython/commit/efd2bac1564f8141a4eab1bf8779b412974b8d69 


commit: efd2bac1564f8141a4eab1bf8779b412974b8d69
branch: master
author: Siddhesh Poyarekar 
committer: Xiang Zhang 
date: 2018-03-06T18:34:35+08:00
summary:

Fix strncpy warning with gcc 8 (#5840)

The length in strncpy is one char too short and as a result it leads
to a build warning with gcc 8.  Comment out the strncpy since the
interpreter aborts immediately after anyway.

files:
M Python/pystrtod.c

diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index 9bf936386210..601f7c691edf 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -1060,8 +1060,8 @@ format_float_short(double d, char format_code,
  else {
  /* shouldn't get here: Gay's code should always return
 something starting with a digit, an 'I',  or 'N' */
-    strncpy(p, "ERR", 3);
-    /* p += 3; */
+    /* strncpy(p, "ERR", 3);
+   p += 3; */
  Py_UNREACHABLE();
  }
  goto exit;



I think this code was added for purpose. In the case of programming 
error we could get meaningful value in post-mortal debugging. But after 
replacing assert(0) with Py_UNREACHABLE this perhaps lost a sense.


If this code is no longer needed it is better to remove it than keeping 
an obscure comment.


What are your thoughts @warsaw and @ericvsmith?

Py_UNREACHABLE was added in issue31338 by Barry. The original code was 
added in issue1580 by Eric Smith (maybe it was copied from other place).


Mark Dickinson and/or I wrote that. I agree that leaving the two 
commented out lines is confusing. I suggest deleting them, and of course 
leave the comment about Gay's code.


Eric

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com