From 9d4a45e25c37162c3fdbd154ef028db758b7c5fe Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue, 28 Aug 2001 02:47:18 +0000
Subject: [PATCH] Avoid #ifdef inside printf() ... that loses on platforms
 where printf() is a macro.

---
 src/interfaces/ecpg/preproc/ecpg.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index bf0dd18d680..2cdcaa999ee 100644
--- a/src/interfaces/ecpg/preproc/ecpg.c
+++ b/src/interfaces/ecpg/preproc/ecpg.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.47 2001/08/24 22:37:36 petere Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.48 2001/08/28 02:47:18 tgl Exp $ */
 
 /* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
 /* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
@@ -29,15 +29,16 @@ help(const char *progname)
 {
 	printf("%s is the PostgreSQL embedded SQL preprocessor for C programs.\n\n",
 		   progname);
-	printf("Usage:\n"
-		   "  %s %s[-I DIRECTORY] [-o OUTFILE] [-t] file1 [file2...]\n\n",
-		   progname,
+	/* printf is a macro some places; don't #ifdef inside its arguments */
 #ifdef YYDEBUG
-		   "[-d] "
+	printf("Usage:\n"
+		   "  %s [-d] [-I DIRECTORY] [-o OUTFILE] [-t] file1 [file2...]\n\n",
+		   progname);
 #else
-		   ""
+	printf("Usage:\n"
+		   "  %s [-I DIRECTORY] [-o OUTFILE] [-t] file1 [file2...]\n\n",
+		   progname);
 #endif
-		);
 	printf("Options:\n");
 #ifdef YYDEBUG
 	printf("  -d                   generate parser debug output\n");
-- 
GitLab