Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 51482 invoked from network); 20 Mar 2008 13:07:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Mar 2008 13:07:17 -0000 Received: (qmail 66718 invoked by uid 500); 20 Mar 2008 13:07:14 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 66697 invoked by uid 500); 20 Mar 2008 13:07:14 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 66688 invoked by uid 99); 20 Mar 2008 13:07:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Mar 2008 06:07:14 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Mar 2008 13:06:44 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 460DD234C0A8 for ; Thu, 20 Mar 2008 06:05:24 -0700 (PDT) Message-ID: <1510101480.1206018324285.JavaMail.jira@brutus> Date: Thu, 20 Mar 2008 06:05:24 -0700 (PDT) From: "Gregory Shimansky (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-5623) [drlvm][thread] Fix warnings from the offsetof() macro In-Reply-To: <774226183.1206014124356.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gregory Shimansky updated HARMONY-5623: --------------------------------------- Assignee: Gregory Shimansky I vote for removing access modifiers as well. > [drlvm][thread] Fix warnings from the offsetof() macro > ------------------------------------------------------ > > Key: HARMONY-5623 > URL: https://issues.apache.org/jira/browse/HARMONY-5623 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Environment: Linux > Reporter: Ilya Berezhniuk > Assignee: Gregory Shimansky > Priority: Minor > Attachments: off_warn2.patch, off_warn_h.patch > > > There are several similar warnings appeared when compiling DRLVM on GCC: > "perhaps the `offsetof` macro was used incorrectly". > All these warnings appear because VM_thread structure becomes non-POD structure with private/public access modifiers. > There are some methods to solve this problem. > 1) The first one is using runtime offset calculation instead of compile-time 'offsetof'. > Such a calculation looks like getting an address of some field of a zeroed local pointer to VM_thread structure. > In release mode compilers turn local var usage into a constant, so there is no performance issue. > The 'off_warn2.patch' implements this solution. > Potential problem of such a method, and of using 'private' modifier in #ifdef at all, is that modern optimising compilers could reorder fields in non-POD structure, and even trow away private fields which are not used. In this case VM_thread fields will be different in C and C++ sources. > 2) Another solution is removing private/public modifiers from VM_thread definition. It's much simpler, and these modifiers actually do not protect anything, because VM_thread to HyThread casting is used everywhere, so everybody can use casted HyThread directly. > The 'off_warn_h.patch' implements this solution. > Thread gurus, please decide what method should be used. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.