Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dBO5B-0002nG-Hm for pgsql-hackers@arkaria.postgresql.org; Thu, 18 May 2017 16:15:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dBO5A-0002Mr-W0 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 May 2017 16:15:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dBO3d-0007NZ-Hk for pgsql-hackers@postgresql.org; Thu, 18 May 2017 16:13:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dBO3Z-0008WH-L7 for pgsql-hackers@postgresql.org; Thu, 18 May 2017 16:13:45 +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 v4IGDai0024705; Thu, 18 May 2017 12:13:36 -0400 From: Tom Lane To: Piotr Stefaniak cc: Alvaro Herrera , Peter Eisentraut , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. In-reply-to: References: <20170517171600.fyxl3lhseszeuqrx@alvherre.pgsql> Comments: In-reply-to Piotr Stefaniak message dated "Wed, 17 May 2017 18:13:16 -0000" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <24311.1495123499.0@sss.pgh.pa.us> Date: Thu, 18 May 2017 12:13:36 -0400 Message-ID: <24704.1495124016@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 ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24311.1495123499.1@sss.pgh.pa.us> Piotr Stefaniak writes: > That, I assume, would be me. Coincidentally, I'm about to push my fixes > upstream (FreeBSD). Before that happens, my changes can be obtained from > https://github.com/pstef/freebsd_indent and tested, if anyone wishes. I spent a little bit of time on portability testing, because we are certainly going to insist that this tool be portable to more than just FreeBSD. Things are not very good as it stands: * Makefile is 100% BSD-specific. Possibly we could just agree to disagree on that point, and include a PG-style makefile that is not like upstream's. I attach the one I used for test purposes. * __FBSDID() macros fail to compile anywhere else than FreeBSD. Couldn't you hide those inside #if 0, as you're already doing for the ancient sccsid strings? * Please put the copyright[] string in indent.c inside #if 0 too, as that draws unreferenced-variable warnings on some compilers. * There's one use of bcopy(), please replace with memmove(). * References to and are problematic, as both are BSD-isms not found in POSIX. They seem to be available anyway on Linux, but I bet not on Windows or SysV-tradition boxes. I removed the includes and didn't see any problems, but removing exposes calls to err() and errx(), which we'd have to find replacements for. Maybe just change them to standard-conforming printf() + exit()? regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-makefile; name="Makefile"; charset="us-ascii" Content-ID: <24311.1495123499.2@sss.pgh.pa.us> Content-Description: Makefile Content-Transfer-Encoding: quoted-printable #------------------------------------------------------------------------- # # Makefile for src/tools/freebsd_indent # # Copyright (c) 2003-2017, PostgreSQL Global Development Group # # src/tools/freebsd_indent/Makefile # #------------------------------------------------------------------------- subdir =3D src/tools/freebsd_indent top_builddir =3D ../../.. include $(top_builddir)/src/Makefile.global override CPPFLAGS :=3D -I. -I$(srcdir) $(CPPFLAGS) OBJS=3D args.o indent.o io.o lexi.o parse.o pr_comment.o all: freebsd_indent freebsd_indent: $(OBJS) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X) install: all installdirs $(INSTALL_PROGRAM) freebsd_indent$(X) '$(DESTDIR)$(bindir)/freebsd_indent$= (X)' installdirs: $(MKDIR_P) '$(DESTDIR)$(bindir)' uninstall: rm -f '$(DESTDIR)$(bindir)/freebsd_indent$(X)' clean distclean maintainer-clean: rm -f freebsd_indent$(X) $(OBJS) ------- =_aaaaaaaaaa0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers ------- =_aaaaaaaaaa0--