diff --git a/doc/src/sgml/gist.sgml b/doc/src/sgml/gist.sgml
index 44a3b2c03c..763b8cf7fd 100644
--- a/doc/src/sgml/gist.sgml
+++ b/doc/src/sgml/gist.sgml
@@ -910,7 +910,7 @@ Datum
 my_fetch(PG_FUNCTION_ARGS)
 {
     GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-    input_data_type *in = DatumGetP(entry->key);
+    input_data_type *in = DatumGetPointer(entry->key);
     fetched_data_type *fetched_data;
     GISTENTRY  *retval;
 
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index fad859a812..7f127e2339 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2784,7 +2784,7 @@ ReadMultiXactCounts(uint32 *multixacts, MultiXactOffset *members)
 
 /*
  * Multixact members can be removed once the multixacts that refer to them
- * are older than every datminxmid.  autovacuum_multixact_freeze_max_age and
+ * are older than every datminmxid.  autovacuum_multixact_freeze_max_age and
  * vacuum_multixact_freeze_table_age work together to make sure we never have
  * too many multixacts; we hope that, at least under normal circumstances,
  * this will also be sufficient to keep us from using too many offsets.
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index fd85b9c8f4..073f313337 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1069,7 +1069,7 @@ rebuild_database_list(Oid newdb)
 		current_time = GetCurrentTimestamp();
 
 		/*
-		 * move the elements from the array into the dllist, setting the
+		 * move the elements from the array into the dlist, setting the
 		 * next_worker while walking the array
 		 */
 		for (i = 0; i < nelems; i++)
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 18a0f62ba6..6c22cbfa29 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -1428,8 +1428,8 @@ GetOldestXmin(Relation rel, int flags)
 		result = replication_slot_xmin;
 
 	/*
-	 * After locks have been released and defer_cleanup_age has been applied,
-	 * check whether we need to back up further to make logical decoding
+	 * After locks have been released and vacuum_defer_cleanup_age has been
+	 * applied, check whether we need to back up further to make logical decoding
 	 * possible. We need to do so if we're computing the global limit (rel =
 	 * NULL) or if the passed relation is a catalog relation of some kind.
 	 */
diff --git a/src/backend/utils/misc/tzparser.c b/src/backend/utils/misc/tzparser.c
index cdb9db475d..0b2900a4b6 100644
--- a/src/backend/utils/misc/tzparser.c
+++ b/src/backend/utils/misc/tzparser.c
@@ -53,7 +53,7 @@ validateTzEntry(tzEntry *tzentry)
 	unsigned char *p;
 
 	/*
-	 * Check restrictions imposed by datetkntbl storage format (see
+	 * Check restrictions imposed by datetktbl storage format (see
 	 * datetime.c)
 	 */
 	if (strlen(tzentry->abbrev) > TOKMAXLEN)
diff --git a/src/include/executor/tablefunc.h b/src/include/executor/tablefunc.h
index 926bd57014..e6fd3d4f01 100644
--- a/src/include/executor/tablefunc.h
+++ b/src/include/executor/tablefunc.h
@@ -20,11 +20,11 @@ struct TableFuncScanState;
  * TableFuncRoutine holds function pointers used for generating content of
  * table-producer functions, such as XMLTABLE.
  *
- * InitBuilder initialize table builder private objects.  The output tuple
+ * InitOpaque initialize table builder private objects.  The output tuple
  * descriptor, input functions for the columns, and typioparams are passed
  * from executor state.
  *
- * SetDoc is called to define the input document.  The table builder may
+ * SetDocument is called to define the input document.  The table builder may
  * apply additional transformations not exposed outside the table builder
  * context.
  *
@@ -45,7 +45,7 @@ struct TableFuncScanState;
  * builder context such that each subsequent GetValue call returns the values
  * for the indicated column for the row being processed.
  *
- * DestroyBuilder shall release all resources associated with a table builder
+ * DestroyOpaque shall release all resources associated with a table builder
  * context.  It may be called either because all rows have been consumed, or
  * because an error occurred while processing the table expression.
  */
diff --git a/src/include/tsearch/ts_public.h b/src/include/tsearch/ts_public.h
index 465a3616a6..531058499f 100644
--- a/src/include/tsearch/ts_public.h
+++ b/src/include/tsearch/ts_public.h
@@ -118,7 +118,7 @@ typedef struct
 
 /*
  * Struct for supporting complex dictionaries like thesaurus.
- * 4th argument for dictlexize method is a pointer to this
+ * 4th argument for thesaurus_lexize method is a pointer to this
  */
 typedef struct
 {
diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile
index 20e3b47874..2ec1023626 100644
--- a/src/interfaces/ecpg/preproc/Makefile
+++ b/src/interfaces/ecpg/preproc/Makefile
@@ -19,7 +19,6 @@ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
 	-I. -I$(srcdir) \
 	-I$(top_srcdir)/src/interfaces/ecpg/ecpglib \
 	-I$(libpq_srcdir) \
-	-DECPG_COMPILE \
 	$(CPPFLAGS)
 
 override CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/src/interfaces/ecpg/preproc/preproc_extern.h b/src/interfaces/ecpg/preproc/preproc_extern.h
index 552ffc627b..7de5cd5087 100644
--- a/src/interfaces/ecpg/preproc/preproc_extern.h
+++ b/src/interfaces/ecpg/preproc/preproc_extern.h
@@ -30,7 +30,6 @@ extern int	braces_open,
 			struct_level,
 			ecpg_internal_var;
 extern char *current_function;
-extern char *descriptor_index;
 extern char *descriptor_name;
 extern char *connection;
 extern char *input_filename;
diff --git a/src/test/regress/regressplans.sh b/src/test/regress/regressplans.sh
index 678ab0a3f2..31e7876daa 100755
--- a/src/test/regress/regressplans.sh
+++ b/src/test/regress/regressplans.sh
@@ -72,7 +72,7 @@ mv -f regression.out planregress/out.in
 mv -f regression.diffs planregress/diffs.in
 PGOPTIONS="$PGOPTIONS      -fi -fn     -fh" $MAKE runtest
 mv -f regression.out planregress/out.inh
-mv -f regression.diffsregression.planregress/inh
+mv -f regression.diffs planregress/diffs.inh
 PGOPTIONS="$PGOPTIONS      -fi -fn -fm    " $MAKE runtest
 mv -f regression.out planregress/out.inm
 mv -f regression.diffs planregress/diffs.inm
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 6f928234ee..d1d0aed07e 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -309,7 +309,6 @@ sub mkvcbuild
 	$ecpg->AddIncludeDir('src/interfaces/libpq');
 	$ecpg->AddPrefixInclude('src/interfaces/ecpg/preproc');
 	$ecpg->AddFiles('src/interfaces/ecpg/preproc', 'pgc.l', 'preproc.y');
-	$ecpg->AddDefine('ECPG_COMPILE');
 	$ecpg->AddReference($libpgcommon, $libpgport);
 
 	my $pgregress_ecpg =
