From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14723 invoked by alias); 3 Jun 2004 23:02:03 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14667 invoked by uid 48); 3 Jun 2004 23:01:52 -0000 Date: Thu, 03 Jun 2004 23:02:00 -0000 Message-ID: <20040603230152.14666.qmail@sourceware.org> From: "jason at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040603143635.15795.ma1flfs@bath.ac.uk> References: <20040603143635.15795.ma1flfs@bath.ac.uk> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/15795] No way to teach operator new anything about alignment requirements X-Bugzilla-Reason: CC X-SW-Source: 2004-06/txt/msg00399.txt.bz2 List-Id: ------- Additional Comments From jason at gcc dot gnu dot org 2004-06-03 23:01 ------- Yes, the bug is in malloc. >>From C99 7.20.3, talking about malloc/realloc: The pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object or an array of such objects in the space allocated (until the space is explicitly deallocated). The rule for operator new is identical. In this case, the pointer returned by malloc, and thence by operator new, is not suitably aligned for a vector, so the program segfaults. -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15795