Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B9CFE200BD8 for ; Wed, 7 Dec 2016 17:33:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B85C0160B0C; Wed, 7 Dec 2016 16:33:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B2982160AF9 for ; Wed, 7 Dec 2016 17:33:10 +0100 (CET) Received: (qmail 67097 invoked by uid 500); 7 Dec 2016 16:33:09 -0000 Mailing-List: contact dev-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list dev@hawq.incubator.apache.org Received: (qmail 67080 invoked by uid 99); 7 Dec 2016 16:33:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2016 16:33:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 67DA21A08B7 for ; Wed, 7 Dec 2016 16:33:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 1r4UkDN0sQqk for ; Wed, 7 Dec 2016 16:33:04 +0000 (UTC) Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 67C845F27E for ; Wed, 7 Dec 2016 16:33:04 +0000 (UTC) Received: by mail-oi0-f50.google.com with SMTP id b126so422170222oia.2 for ; Wed, 07 Dec 2016 08:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ie5U90EKzwK1ImGYLUGpN2hA/JPeMs5rMUa+G23B9XM=; b=IHfGm9LigZ/cNbtPdjN8d9tmg1y0Xl8FmFOz2gkbUHWvIWlzLN2Gto4yh3ma6vhngf cgDEWbt7HkpM3toBZXGWkFIkeXyhzt/6q24wAIv1KFhvHxWVV+Fd+RVTC/wXiwqcwfdV qiY/IVpGtjB8nX6h7rmWGMZEnthPiFz0h19kb30xh/FFayjMULi/avx8tF3d5Zinfirw F3rd/TX8ofV/lA72tDSZ7lkIf9UXqHSRuT+DfkS0/6c10DNNjMBR9E0W8LiTrGzt636C AH/GSbNK7LLhlSKJFsNMbf2h+jJKRpADpXXIoOkh8PJYcMq2HYysYjZIoUmUOqgdKkST +ONw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ie5U90EKzwK1ImGYLUGpN2hA/JPeMs5rMUa+G23B9XM=; b=LWpPDugbRUgHi1COwVZSU6JuQq3JHYjTzcgw/qYT3MacVDoeIgBGuVGqzuTe5gzjoT vKWNFVEhdZaXx9hrEXi6wS6mSp+XdNQ8cvm6/nuUD1NdYq4hzsDOBaOHvrSQpOKXWgwA ThVSYy6QylVVz5Zjwd60d+HVcxTYs0yw8QU3LKhXQBKESiqlLMpW2EziVfaVUh71ZKgq AwUehmYKzVfw9HXImoBwD8hrela6TcOzW615nrjs2Ul0Wy35/hGNZfopWIGAJdf+gHFm LJ0RlNpMOvH8qiesxoOuKFnBQRuZgXYMdCWp/vwHrI65J1Ug5vO2MW2lXnfDNF59pnKh r9UA== X-Gm-Message-State: AKaTC02K5LI3D80snXPfEa2Z8mOMZoNWTg3R71LG02GTZbd3BsBDdpT+eui37vAd6gLDW8aHaG0mWwMZxNk8+A== X-Received: by 10.202.78.140 with SMTP id c134mr33544648oib.198.1481128376788; Wed, 07 Dec 2016 08:32:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.165.69 with HTTP; Wed, 7 Dec 2016 08:32:56 -0800 (PST) In-Reply-To: References: From: Hong Wu Date: Thu, 8 Dec 2016 00:32:56 +0800 Message-ID: Subject: Re: Warnings and indent issues in HAWQ code. To: dev@hawq.incubator.apache.org Content-Type: multipart/alternative; boundary=001a11c160f6c3edbb05431412b2 archived-at: Wed, 07 Dec 2016 16:33:11 -0000 --001a11c160f6c3edbb05431412b2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Status update: I am working on the following warnings in my next relevant pull request, "-Wimplicit-function-declaration" "-Wgnu-variable-sized-type-not-at-end" "-Wuninitialized" "-Wunused-variable" "-Wunused-function" "-Wmissing-prototypes" "-Wtautological-pointer-compare" "-Wincompatible-pointer-types" Please pick remaining warnings below: "-Wdeprecated-declarations" "-Wformat" "-Wformat-extra-args" "-Wmacro-redefined" Thanks, Hong 2016-12-05 23:35 GMT+08:00 Hong Wu : > I am working on following warnings in my next relevant pull request, > "-Wimplicit-function-declaration" > "-Wgnu-variable-sized-type-not-at-end" > "-Wtypedef-redefinition" > "-Wincompatible-pointer-types" > "-Wconstant-logical-operand" > "-Wmemsize-comparison" > "-Wnull-dereference" > "-Wpointer-sign" > "-Wint-conversion" > > Please pick remaining warning types below: > "-Wformat" > "-Wformat-extra-args" > "-Wuninitialized" > "-Wunused-variable" > "-Wunused-function" > "-Wpointer-sign" > "-Wmacro-redefined" > "-Wmissing-prototypes" > "-Wdeprecated-declarations" > "-Wtautological-pointer-compare" > > Thanks, > Hong > > 2016-12-05 13:52 GMT+08:00 Hong Wu : > >> Ok, if we work together, that's sgreat! The remaining warning options >> include: >> >> "-Wuninitialized" >> "-Wtypedef-redefinition" >> "-Wunused-variable" >> "-Wunused-function" >> "-Wgnu-variable-sized-type-not-at-end" >> "-Wmissing-prototypes" >> "-Wdeprecated-declarations" >> "-Wmacro-redefined" >> "-Wformat" >> "-Wimplicit-function-declaration" >> "-Wtautological-pointer-compare" >> "-Wincompatible-pointer-types" >> "-Wformat-extra-args" >> "-Wconstant-logical-operand" >> "-Wmemsize-comparison" >> "-Wpointer-sign" >> "-Wnumm-dereference" >> "-Wpointer-sign" >> "-Wint-conversion" >> >> If anybody picks some of them, please reply to this thread to avoid >> repeated work. Thanks. >> >> >> 2016-12-05 13:44 GMT+08:00 Lili Ma : >> >>> I reviewed the PR too. >>> >>> This work is very important. Sometimes it reflects as a warning, but >>> actually it's a potential bug which is not covered by our tests. >>> >>> Since there are a number of work there, let's work together to fix the >>> warnings. >>> >>> Thanks Paul for heading up and thanks for Hong's work! >>> >>> Thanks >>> Lili >>> >>> >>> On Mon, Dec 5, 2016 at 1:26 PM, Paul Guo wrote: >>> >>> > I just reviewed one of the warning fix related PRs which come from >>> Hong. >>> > >>> > https://github.com/apache/incubator-hawq/pull/1036 >>> > >>> > it catches several obvious bugs. I guess applying -Werror and static >>> code >>> > check will keep helping the code quality of HAWQ. >>> > >>> > Thanks for Hong's work. >>> > >>> > >>> > 2016-12-01 15:37 GMT+08:00 Hong Wu : >>> > >>> > > Thanks Paul to point it out. I will start fixing these warnings as >>> > possible >>> > > as I can! >>> > > >>> > > Hong >>> > > >>> > > 2016-12-01 14:17 GMT+08:00 Paul Guo : >>> > > >>> > > > I'm proposing the Macros below at first to help eliminate some >>> "unused" >>> > > > variable/argument warnings. >>> > > > >>> > > > Typical cases: >>> > > > >>> > > > 1) Variable is only used with some configurations, etc. val for >>> > > > Assert(val). Then you could add the code below >>> > > > to eliminate the warning when assert is not enabled. >>> > > > >>> > > > POSSIBLE_UNUSED_VAR(val); >>> > > > >>> > > > 2) For argument that is explicitly unused but might be kept for >>> > > > compatibility, you could use UNUSED_ARG(). >>> > > > >>> > > > [pguo@host67:/data2/github/incubator-hawq-a/src/include]$ git dif= f >>> > > > diff --git a/src/include/postgres.h b/src/include/postgres.h >>> > > > index 1138f20..9391d6b 100644 >>> > > > --- a/src/include/postgres.h >>> > > > +++ b/src/include/postgres.h >>> > > > @@ -513,6 +513,18 @@ extern void gp_set_thread_sigmasks(void); >>> > > > >>> > > > extern void OnMoveOutCGroupForQE(void); >>> > > > >>> > > > +#ifndef POSSIBLE_UNUSED_VAR >>> > > > +#define POSSIBLE_UNUSED_VAR(x) ((void)x) >>> > > > +#endif >>> > > > + >>> > > > +#ifndef POSSIBLE_UNUSED_ARG >>> > > > +#define POSSIBLE_UNUSED_ARG(x) ((void)x) >>> > > > +#endif >>> > > > + >>> > > > +#ifndef UNUSED_ARG >>> > > > +#define UNUSED_ARG(x) ((void)x) >>> > > > +#endif >>> > > > + >>> > > > #ifdef __cplusplus >>> > > > } /* extern "C" */ >>> > > > #endif >>> > > > >>> > > > 2016-12-01 10:26 GMT+08:00 Yandong Yao : >>> > > > >>> > > > > Great, +dev@hawq.incubator.apache.org >>> > > > > >>> > > > > On Thu, Dec 1, 2016 at 9:54 AM, Paul Guo >>> wrote: >>> > > > > >>> > > > >> Yes, strongly agree. >>> > > > >> >>> > > > >> By the way, We should keep updating your story progress on >>> Apache >>> > JIRA >>> > > > if >>> > > > >> your story is not confidential. >>> > > > >> >>> > > > >> We should try to avoid closing an Apache JIRA with just a simp= le >>> > > > >> introduction, i.e. without analysis, without progress, without >>> root >>> > > > cause. >>> > > > >> >>> > > > >> On Thu, Dec 1, 2016 at 9:13 AM, Ruilong Huo >>> > wrote: >>> > > > >> >>> > > > >>> Strong +1 to move discussions about features, improvements, >>> usages, >>> > > etc >>> > > > >>> in dev@hawq.incubator.apache.org and >>> > user@hawq.incubator.apache.org >>> > > > >>> respectively! This improve interactions between us and >>> developers >>> > and >>> > > > user, >>> > > > >>> which in turn helps to grow hawq community in apache open >>> source >>> > > > society. >>> > > > >>> >>> > > > >>> =E2=80=8B >>> > > > >>> >>> > > > >>> Best regards, >>> > > > >>> Ruilong Huo >>> > > > >>> >>> > > > >>> On Thu, Dec 1, 2016 at 8:59 AM, Yandong Yao >>> > wrote: >>> > > > >>> >>> > > > >>>> Thanks Paul for initiating this discussion, +1 for -Werror a= nd >>> > using >>> > > > >>>> pgindent. >>> > > > >>>> >>> > > > >>>> Besides, could we move such discussion to >>> > > > dev@hawq.incubator.apache.org, >>> > > > >>>> it is perfect topic to discuss in open source community! >>> > > > >>>> >>> > > > >>>> On Wed, Nov 30, 2016 at 5:58 PM, Hong Wu >>> wrote: >>> > > > >>>> >>> > > > >>>>> If we want to do this, I recommend to write the coding styl= e >>> > > inside a >>> > > > >>>>> hawq.vim and a hawq.emacs file for developers to use. I agr= ee >>> > with >>> > > > you that >>> > > > >>>>> to fix compile warnings and coding styles including indents= , >>> we >>> > do >>> > > > this >>> > > > >>>>> together with some bug fix which could minimize our effort. >>> > > > >>>>> >>> > > > >>>>> Hong >>> > > > >>>>> >>> > > > >>>>> On Wed, Nov 30, 2016 at 5:46 PM, Paul Guo >>> > wrote: >>> > > > >>>>> >>> > > > >>>>>> Sorry. I meant -Werror (Which means "warning as error"). >>> > > > >>>>>> >>> > > > >>>>>> I did not tried pgindent. Anyone knows this whether works >>> for >>> > us. >>> > > By >>> > > > >>>>>> the way, even this works I suspect there will be tons of >>> > warnings >>> > > > also then >>> > > > >>>>>> we have to leave this to be fixed along with other fixes. >>> > > > >>>>>> >>> > > > >>>>>> Besides, pg have a coding style doc but that is very >>> simple. I >>> > saw >>> > > > at >>> > > > >>>>>> least our naming conventions are not uniform. This will be >>> an >>> > more >>> > > > annoying >>> > > > >>>>>> issue. >>> > > > >>>>>> >>> > > > >>>>>> On Wed, Nov 30, 2016 at 5:29 PM, Hong Wu >>> > wrote: >>> > > > >>>>>> >>> > > > >>>>>>> There is no harm to fix compile warnings. Just do it, pau= l! >>> > > > >>>>>>> >>> > > > >>>>>>> In "enforce -Werror (if gcc) in hawq" thread of dev maili= ng >>> > list, >>> > > > >>>>>>> we talked about opening "-Werror" but there were some >>> concerns >>> > > > about >>> > > > >>>>>>> the portability issue. I think it's better to fix compile >>> > > warnings >>> > > > but do >>> > > > >>>>>>> not open this option. >>> > > > >>>>>>> >>> > > > >>>>>>> For indent and code style, HAWQ contains a tool for check >>> that >>> > at >>> > > > >>>>>>> "src/tools/pgindent" which is forked from original >>> Postgres. I >>> > > > think we >>> > > > >>>>>>> should run the tool to check existing code and do some >>> indent >>> > > > fixes. >>> > > > >>>>>>> Meanwhile, we should also use this tool to check our >>> c-coding >>> > > > indent before >>> > > > >>>>>>> sending pull requests and reviewer should pay attention t= o >>> > indent >>> > > > too. >>> > > > >>>>>>> >>> > > > >>>>>>> Best, >>> > > > >>>>>>> Hong >>> > > > >>>>>>> >>> > > > >>>>>>> On Wed, Nov 30, 2016 at 5:00 PM, Paul Guo >> > >>> > > wrote: >>> > > > >>>>>>> >>> > > > >>>>>>>> Hi team, >>> > > > >>>>>>>> >>> > > > >>>>>>>> Long ago, I proposed to add "-Wall" (warning as error) >>> option >>> > in >>> > > > >>>>>>>> the community and later found that is a big effort since >>> > > warnings >>> > > > are too >>> > > > >>>>>>>> many, but I think the direction is right. I think we >>> should >>> > try >>> > > > to fix >>> > > > >>>>>>>> those warnings when you are modifying related source fil= e, >>> > > > besides, I found >>> > > > >>>>>>>> indent issue is a bit severe, so if you encountered this >>> > during >>> > > > bug fixes >>> > > > >>>>>>>> please fix them. All of these will improve the confidenc= e >>> of >>> > > > users and >>> > > > >>>>>>>> customers. >>> > > > >>>>>>>> >>> > > > >>>>>>>> Thanks. >>> > > > >>>>>>>> >>> > > > >>>>>>> >>> > > > >>>>>>> >>> > > > >>>>>> >>> > > > >>>>> >>> > > > >>>> >>> > > > >>>> >>> > > > >>>> -- >>> > > > >>>> Best Regards, >>> > > > >>>> Yandong >>> > > > >>>> >>> > > > >>> >>> > > > >>> >>> > > > >> >>> > > > > >>> > > > > >>> > > > > -- >>> > > > > Best Regards, >>> > > > > Yandong >>> > > > > >>> > > > >>> > > >>> > >>> >> >> > --001a11c160f6c3edbb05431412b2--