From commits-return-8388-archive-asf-public=cust-asf.ponee.io@nuttx.apache.org Wed Apr 29 16:31:12 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 25F46180654 for ; Wed, 29 Apr 2020 18:31:12 +0200 (CEST) Received: (qmail 14339 invoked by uid 500); 29 Apr 2020 16:31:11 -0000 Mailing-List: contact commits-help@nuttx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nuttx.apache.org Delivered-To: mailing list commits@nuttx.apache.org Received: (qmail 14330 invoked by uid 99); 29 Apr 2020 16:31:11 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2020 16:31:11 +0000 From: =?utf-8?q?GitBox?= To: commits@nuttx.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-nuttx=5D_btashton_commented_on_a_change_?= =?utf-8?q?in_pull_request_=23904=3A_Resolve_linking_issues_with_x86=5F64_po?= =?utf-8?q?rt?= Message-ID: <158817787148.26397.13437531583303258361.asfpy@gitbox.apache.org> Date: Wed, 29 Apr 2020 16:31:11 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit References: In-Reply-To: btashton commented on a change in pull request #904: URL: https://github.com/apache/incubator-nuttx/pull/904#discussion_r417450328 ########## File path: arch/x86_64/src/intel64/intel64_lowsetup.c ########## @@ -64,16 +77,16 @@ void up_lowsetup(void) /* Setup pointers for accessing Page table and GDT in high address */ - pdpt = &pdpt_low + X86_64_LOAD_OFFSET; - pd = &pd_low + X86_64_LOAD_OFFSET; - pt = &pt_low + X86_64_LOAD_OFFSET; + pdpt = (uint64_t *)((uint64_t)&pdpt_low + X86_64_LOAD_OFFSET); + pd = (uint64_t *)((uint64_t)&pd_low + X86_64_LOAD_OFFSET); + pt = (uint64_t *)((uint64_t)&pt_low + X86_64_LOAD_OFFSET); - ist64 = (struct ist_s *)((void *)&ist64_low + X86_64_LOAD_OFFSET); - gdt64 = (struct gdt_entry_s *)((void *)&gdt64_low + X86_64_LOAD_OFFSET); + ist64 = (struct ist_s *)((uint64_t)&ist64_low + X86_64_LOAD_OFFSET); + gdt64 = (struct gdt_entry_s *)((uint64_t)&gdt64_low + X86_64_LOAD_OFFSET); Review comment: The compiler complains about aliasing, biggest issue here is that you need to cast to not the pointer type first otherwise if thinks if is uint8[] which overflows. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org