Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yb9h7-0003Uh-Aq for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2015 15:27:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yb9h6-0008Qb-On for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2015 15:27:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yb9h5-0008QQ-Bc for pgsql-hackers@postgresql.org; Thu, 26 Mar 2015 15:27:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yb9h2-0002og-A6 for pgsql-hackers@postgresql.org; Thu, 26 Mar 2015 15:27:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t2QFRWbM008059; Thu, 26 Mar 2015 11:27:33 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org Subject: Re: Re: [COMMITTERS] pgsql: Add macros wrapping all usage of gcc's __attribute__. In-reply-to: <20150326131955.GG451@alap3.anarazel.de> References: <14247.1427325066@sss.pgh.pa.us> <20150326131955.GG451@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 26 Mar 2015 14:19:55 +0100" Date: Thu, 26 Mar 2015 11:27:32 -0400 Message-ID: <8058.1427383652@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > On 2015-03-25 19:11:06 -0400, Tom Lane wrote: >> I think this is a bad idea, because it's going to look like heck after >> pgindent gets through with it. Do we actually need decoration on the >> function definitions? > Hm, I guess it should not look any worse than before? It does, because pgindent treats "pg_attribute_noreturn" differently than it treated "__attribute__((noreturn))". Before you'd end up with something like void __attribute__((noreturn)) plpgsql_yyerror(const char *message) { pgindent forced the __attribute__(()) bit onto its own line, whether you wrote it that way or not, but it doesn't look *too* awful. But now that becomes: void pg_attribute_noreturn plpgsql_yyerror(const char *message) { The best you can get is to manually put the noreturn back onto the "void" line, but you still end up with: void pg_attribute_noreturn plpgsql_yyerror(const char *message) { So this is just ugly. Maybe we could teach pgindent not to do that, but I'm doubtful. > ... That said, I see little reason > to add the noreturn thingy to the definition and not the declaration for > those. It actually looks to me like there's a declaration for > replication_yyerror, but a plain yyerror is used instead in repl_scanner.l? Right. Also, even in the context of extern declarations, it seems to be a lot easier to get pgindent not to mess with your layout if "pg_attribute_noreturn" is replaced with "pg_attribute_noreturn()". I see no particular reason not to add parens to the macro, do you? Being the one complaining, I'll go do the legwork to clean this up. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers