From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21346 invoked by alias); 5 Mar 2014 09:19:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21317 invoked by uid 48); 5 Mar 2014 09:19:04 -0000 From: "jaak at ristioja dot ee" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/60421] New: std::this_thread::sleep_for doesn't sleep for all arguments Date: Wed, 05 Mar 2014 09:19:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jaak at ristioja dot ee X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg00317.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60421 Bug ID: 60421 Summary: std::this_thread::sleep_for doesn't sleep for all arguments Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: jaak at ristioja dot ee #include #include #include int main() { =20=20=20 std::this_thread::sleep_for(std::chrono::duration(std::numeric_li= mits::max())); return 0; } This doesn't even sleep a millisecond. Relevant strace output: nanosleep({18446744073709551615, 0}, NULL) =3D -1 EINVAL (Invalid argumen= t) Hence the =C2=A730.3.2.7 of the C++11 standard is violated as sleep_for doe= s not sleep by the relative amount of time specified by its argument. Bug may be = run into during testing. Also happens with 4.7.3. >>From gcc-bugs-return-445449-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Mar 05 09:24:08 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 27677 invoked by alias); 5 Mar 2014 09:24:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 27633 invoked by uid 48); 5 Mar 2014 09:24:05 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/60422] New: headers should give a diagnostic when included directly Date: Wed, 05 Mar 2014 09:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg00318.txt.bz2 Content-length: 953 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60422 Bug ID: 60422 Summary: headers should give a diagnostic when included directly Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Some users do dumb things like: #include #include #include #include and expect to be able to use std::shared_ptr. This happens to work with GCC 4.8, but not with 4.9 because we re-arranged some headers to allow the library to use shared_ptr internally. In order to stop this nonsense we should add preprocessor checks to the headers: #ifndef _MEMORY #error Do not include this header directly, use instead #else ... #endif