diff --git a/contrib/btree_gist/btree_utils_num.h b/contrib/btree_gist/btree_utils_num.h
index 1fedfbe82d..cec6986172 100644
--- a/contrib/btree_gist/btree_utils_num.h
+++ b/contrib/btree_gist/btree_utils_num.h
@@ -74,7 +74,7 @@ typedef struct
 	(*(result)) += (float) ( ((double)(tmp)) / ( (double)(tmp) + ( ((double)(oupper))*0.49F - ((double)(olower))*0.49F ) ) ); \
 	(*(result)) *= (FLT_MAX / (((GISTENTRY *) PG_GETARG_POINTER(0))->rel->rd_att->natts + 1)); \
   } \
-} while (0);
+} while (0)
 
 
 /*
diff --git a/contrib/pg_trgm/trgm.h b/contrib/pg_trgm/trgm.h
index 0c34b96d80..b616953462 100644
--- a/contrib/pg_trgm/trgm.h
+++ b/contrib/pg_trgm/trgm.h
@@ -48,7 +48,7 @@ typedef char trgm[3];
 	*(((char*)(a))+0) = *(((char*)(b))+0);	\
 	*(((char*)(a))+1) = *(((char*)(b))+1);	\
 	*(((char*)(a))+2) = *(((char*)(b))+2);	\
-} while(0);
+} while(0)
 
 #ifdef KEEPONLYALNUM
 #define ISWORDCHR(c)	(t_isalpha(c) || t_isdigit(c))
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index e991385059..d09bc6d291 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -3859,7 +3859,7 @@ do { \
 	(path) = reparameterize_path_by_child(root, (path), child_rel); \
 	if ((path) == NULL) \
 		return NULL; \
-} while(0);
+} while(0)
 
 #define REPARAMETERIZE_CHILD_PATH_LIST(pathlist) \
 do { \
@@ -3870,7 +3870,7 @@ do { \
 		if ((pathlist) == NIL) \
 			return NULL; \
 	} \
-} while(0);
+} while(0)
 
 	Path	   *new_path;
 	ParamPathInfo *new_ppi;
diff --git a/src/backend/utils/sort/gen_qsort_tuple.pl b/src/backend/utils/sort/gen_qsort_tuple.pl
index 9ed6cfc7ea..eb0f7c5814 100644
--- a/src/backend/utils/sort/gen_qsort_tuple.pl
+++ b/src/backend/utils/sort/gen_qsort_tuple.pl
@@ -126,7 +126,7 @@ swapfunc(SortTuple *a, SortTuple *b, size_t n)
 		SortTuple t = *(a);				\
 		*(a) = *(b);					\
 		*(b) = t;						\
-	} while (0);
+	} while (0)
 
 #define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n)
 
diff --git a/src/include/access/hash.h b/src/include/access/hash.h
index 94b643cc77..7e7b1b73d8 100644
--- a/src/include/access/hash.h
+++ b/src/include/access/hash.h
@@ -148,7 +148,7 @@ typedef struct HashScanPosData
 		(scanpos).firstItem = 0; \
 		(scanpos).lastItem = 0; \
 		(scanpos).itemIndex = 0; \
-	} while (0);
+	} while (0)
 
 /*
  *	HashScanOpaqueData is private state for a hash index scan.
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h
index 9a3acd26b7..f976ba0270 100644
--- a/src/include/access/nbtree.h
+++ b/src/include/access/nbtree.h
@@ -888,7 +888,7 @@ typedef BTScanPosData *BTScanPos;
 		(scanpos).buf = InvalidBuffer; \
 		(scanpos).lsn = InvalidXLogRecPtr; \
 		(scanpos).nextTupleOffset = 0; \
-	} while (0);
+	} while (0)
 
 /* We need one of these for each equality-type SK_SEARCHARRAY scan key */
 typedef struct BTArrayKeyInfo
