From: Tom Lane <tgl@sss.pgh.pa.us>
To: Piotr Stefaniak <postgres@piotr-stefaniak.me>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
Date: Thu, 18 May 2017 12:13:36 -0400
Message-ID: <24704.1495124016@sss.pgh.pa.us> (raw)
In-Reply-To: <AM3PR03MB1188858CCD55BC737C856F65F2E70@AM3PR03MB1188.eurprd03.prod.outlook.com>
References: <20170517171600.fyxl3lhseszeuqrx@alvherre.pgsql>
<AM3PR03MB1188858CCD55BC737C856F65F2E70@AM3PR03MB1188.eurprd03.prod.outlook.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Piotr Stefaniak <postgres@piotr-stefaniak.me> 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 <sys/cdefs.h> and <err.h> 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 <sys/cdefs.h> includes and didn't see any problems,
but removing <err.h> 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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:
[text/x-makefile] Makefile (894B, ../24704.1495124016@sss.pgh.pa.us/2-Makefile)
download | inline:
#-------------------------------------------------------------------------
#
# Makefile for src/tools/freebsd_indent
#
# Copyright (c) 2003-2017, PostgreSQL Global Development Group
#
# src/tools/freebsd_indent/Makefile
#
#-------------------------------------------------------------------------
subdir = src/tools/freebsd_indent
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
OBJS= 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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, postgres@piotr-stefaniak.me, alvherre@2ndquadrant.com, peter.eisentraut@2ndquadrant.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
In-Reply-To: <24704.1495124016@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox