public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "john.salmon at deshaw dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/50510] New: transposed variable names in std::seed_seq::generate Date: Sat, 24 Sep 2011 22:35:00 -0000 [thread overview] Message-ID: <bug-50510-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50510 Bug #: 50510 Summary: transposed variable names in std::seed_seq::generate Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: john.salmon@deshaw.com The C++11 "Final Draft International Standard" (FDIS n3290.pdf) fixes a defect in the "Final Committee Draft" (FCD n3092.pdf), swapping the use of the intermediate variables r3 and r4 in the std::seed_seq::generate() function. See 25.5.7.1 paragraph 8c. This patch brings libstdc++ up-to-date: salmonj@drdlogin0039.en.desres$ diff -u oldrandom.tcc random.tcc --- oldrandom.tcc 2011-09-19 10:04:46.836512000 -0400 +++ random.tcc 2011-09-24 17:45:02.879621416 -0400 @@ -2796,8 +2796,8 @@ _Type __r4 = __r3 - __k % __n; __r4 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value>(__r4); - __begin[(__k + __p) % __n] ^= __r4; - __begin[(__k + __q) % __n] ^= __r3; + __begin[(__k + __p) % __n] ^= __r3; + __begin[(__k + __q) % __n] ^= __r4; __begin[__k % __n] = __r4; } } salmonj@drdlogin0039.en.desres$
next reply other threads:[~2011-09-24 21:54 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-09-24 22:35 john.salmon at deshaw dot com [this message] 2011-09-24 22:35 ` [Bug libstdc++/50510] " paolo.carlini at oracle dot com 2011-09-24 22:36 ` paolo at gcc dot gnu.org 2011-09-24 22:44 ` paolo at gcc dot gnu.org 2011-09-24 22:46 ` paolo.carlini at oracle dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-50510-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).