Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYmVx-0002ui-8Z for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 08:13:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYmVw-0000Lk-6L for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 08:13:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYmVv-0000Ld-Vv for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2020 08:13:15 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jYmVs-0001yE-Te for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2020 08:13:15 +0000 Received: by mail-pg1-x543.google.com with SMTP id r22so5860460pga.12 for ; Wed, 13 May 2020 01:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=LhTFiDUTjcipw6f5A02chW83Fx6COnVsaKRJm9P7sNI=; b=Im2FDpX7L7D68cn00hPnvgASAPBk3a99TgjW80mIlcJnQwOSn7aRxIz6vxuHXOev/K QvxttbhdjIIUKu8FtF40Y7pO4IlJXQNQGK3vqAIZZzr36Vu1mptv2bsqdxhvMRavxpBa 8mZsYenTzIFux8d5MNa6Fb7a+k4q50KUOXZg5y4H9/zwfBO2ZIbDVxWPG73dhPaSD/vA rVgYrOQ6Dn593W2w1s3/qOOqsZobvRDbjhHkJPcw0PgusP4PK3K/3+B6hMk/JsY9QkYd AecDi25IPc552MYUCGRry6Tc0RKt5ESroOD5QX9OGI+CEVzvML9QVofKHgeW/MTFcobj nicA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=LhTFiDUTjcipw6f5A02chW83Fx6COnVsaKRJm9P7sNI=; b=Dms5Mm7n60T3yYU4jR27oRwwArXsa/l2r6Wm4Ry9IJSOR1Uyd8IH/9lQIiPmVez47P 92DFXajZVVhbJBCeETPg76nyb4Zfc9aq5NfVTBRQ0OIiyo19O5Fs69DD5W3BvTFBrx84 cuSOYuiDda0wpPIRnllgilOGlMy8A2F+eNg3WEG04yRUxZ8tw9REtd/m16Wi2mC+CTyY H5eLOxOpctwVZi+L075uO7ABx4x8dqylRyfIx4Eb8NDOoys05GKr1Vz0TocPNtic/DgU JiP3igMVfqGiSqcF0FAt3Ea3lgFgKGjekmbZiWajUg+zGheGSF753DuqOAlW3Nch1bN+ y2dg== X-Gm-Message-State: AGi0PuZXwUeGSRn5EaKQVsVbycdypTu54GlDniVNheo5gQL7zmetEmoF SqCJkRR88yovUrdMYVHIvMs= X-Google-Smtp-Source: APiQypLYLZQ62yH1gvqgovlBFGaJAMC2dyvUWsiEbdibQzq1TMwJihNbJ2bsMG85/1FQrgslG13Jeg== X-Received: by 2002:aa7:957c:: with SMTP id x28mr25071738pfq.31.1589357591141; Wed, 13 May 2020 01:13:11 -0700 (PDT) Received: from localhost (ag027197.dynamic.ppp.asahi-net.or.jp. [157.107.27.197]) by smtp.gmail.com with ESMTPSA id d20sm14364145pjs.12.2020.05.13.01.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 01:13:10 -0700 (PDT) Date: Wed, 13 May 2020 17:13:07 +0900 (JST) Message-Id: <20200513.171307.166314920588793962.horikyota.ntt@gmail.com> To: tgl@sss.pgh.pa.us Cc: alvherre@2ndquadrant.com, rjuju123@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: Add "-Wimplicit-fallthrough" to default flags From: Kyotaro Horiguchi In-Reply-To: <7193.1589317971@sss.pgh.pa.us> References: <20200512202524.GA30825@alvherre.pgsql> <7193.1589317971@sss.pgh.pa.us> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk At Tue, 12 May 2020 17:12:51 -0400, Tom Lane wrote in > Alvaro Herrera writes: > > Fixed one straggler in contrib, and while testing it I realized why > > ccache doesn't pay attention to the changes I was doing in the file: > > ccache compares the *preprocessed* version of the file and only if that > > differs from the version that was cached last, ccache sends the new one > > to the compiler; and of course these comments are not present in the > > preprocessed version, so changing only the comment accomplishes nothing. > > You have to touch one byte outside of any comments. > > Ugh. So the only way ccache could avoid this is to drop the > preprocessed-file comparison check if -Wimplicit-fallthrough is on. > Doesn't really sound like something we'd want to ask them to do. > > > I bet this is going to bite someone ... maybe we'd be better off going > > all the way to -Wimplicit-fallthrough=5 and use the > > __attribute__((fallthrough)) stuff instead. > > I'm not really in favor of the __attribute__ solution --- seems too > gcc-specific. FALLTHROUGH-type comments are understood by other > sorts of tools besides gcc. > > In practice, it doesn't seem like this'll be a huge problem once > we're past the initial fixup stage. We can revisit it later if > that prediction proves wrong, of course. FWIW, I got a warning for jsonpath_gram.c. > jsonpath_gram.c:1026:16: warning: this statement may fall through [-Wimplicit-fallthrough=] > if (*++yyp != '\\') > ^ > jsonpath_gram.c:1029:11: note: here > default: > ^~~~~~~ jsonpath_gram.c:1025 > case '\\': > if (*++yyp != '\\') > goto do_not_strip_quotes; > /* Fall through. */ > default: It is generated code by bison. $ bison --version bison (GNU Bison) 3.0.4 regards. -- Kyotaro Horiguchi NTT Open Source Software Center