This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Initialize strtok_r's saveptr to NULL
- From: Pedro Alves <palves at redhat dot com>
- To: Manish Goregaokar <manish at mozilla dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 29 Jun 2016 16:12:31 +0100
- Subject: Re: [PATCH] Initialize strtok_r's saveptr to NULL
- Authentication-results: sourceware.org; auth=none
- References: <CAFOnWknprKQpWy3TU1x7cZZ7n+=nJyw7nhHme9KtLxiv8GasbQ at mail dot gmail dot com> <faa72bac-65a0-ad08-b00c-ae95c2ec44f6 at redhat dot com> <CAFOnWk=WkGWGP9OR8gwnnbMAaRSVMkrgW8ZOSikQ67iG6jpRrg at mail dot gmail dot com>
On 06/29/2016 03:42 PM, Manish Goregaokar wrote:
> Fixed and pushed.
Thanks. Please don't put the "gdb/ChangeLog:" lines in the
ChangeLog file though. :-)
>
> Is this something we can fix in gcc? Pointer overflow is UB IIRC so
> <nonnullptr>+<positive thing> should never be null. Not sure if the
> compiler knows that this is positive though.
I'd hope so. Was already working on a minimal reproducer. :-)
Filed a gcc bug now:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71699
Thanks,
Pedro Alves