Patchwork [pushed,2/2] Fix test-cp-name-parser build, parser_fprintf undefined

login
register
mail settings
Submitter Pedro Alves
Date March 12, 2019, 5:03 p.m.
Message ID <20190312170327.14109-3-palves@redhat.com>
Download mbox | patch
Permalink /patch/31826/
State New
Headers show

Comments

Pedro Alves - March 12, 2019, 5:03 p.m.
$ make test-cp-name-parser
  ...
  test-cp-name-parser.o: In function `yy_symbol_print(_IO_FILE*, int, YYSTYPE const*, cpname_state*)':
  build/gdb/cp-name-parser.c.tmp:1335: undefined reference to `parser_fprintf(_IO_FILE*, char const*, ...)'
  build/gdb/cp-name-parser.c.tmp:1339: undefined reference to `parser_fprintf(_IO_FILE*, char const*, ...)'
  test-cp-name-parser.o: In function `yy_stack_print(short*, short*)':
  build/gdb/cp-name-parser.c.tmp:1350: undefined reference to `parser_fprintf(_IO_FILE*, char const*, ...)'
  build/gdb/cp-name-parser.c.tmp:1354: undefined reference to `parser_fprintf(_IO_FILE*, char const*, ...)'
  build/gdb/cp-name-parser.c.tmp:1356: undefined reference to `parser_fprintf(_IO_FILE*, char const*, ...)'
  build/gdb/cp-name-parser.c.tmp:1376: more undefined references to `parser_fprintf(_IO_FILE*, char const*, ...)' follow
  collect2: error: ld returned 1 exit status
  make: *** [Makefile:1833: test-cp-name-parser] Error 1

gdb/ChangeLog:
2019-03-12  Pedro Alves  <palves@redhat.com>

	* yy-remap.h [TEST_CPNAMES] (YYFPRINTF): Don't define.
---
 gdb/ChangeLog  | 4 ++++
 gdb/yy-remap.h | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 44aa9a3b94..2ca2493c0e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@ 
+2019-03-12  Pedro Alves  <palves@redhat.com>
+
+	* yy-remap.h [TEST_CPNAMES] (YYFPRINTF): Don't define.
+
 2019-03-12  Pedro Alves  <palves@redhat.com>
 
 	* cp-name-parser.y (main): Remove unused 'len' variable.
diff --git a/gdb/yy-remap.h b/gdb/yy-remap.h
index 579b7d2aee..cdd0aae8c6 100644
--- a/gdb/yy-remap.h
+++ b/gdb/yy-remap.h
@@ -92,6 +92,8 @@ 
 # define YYDEBUG 1  /* Default to yydebug support */
 #endif
 
-#define YYFPRINTF parser_fprintf
+#ifndef TEST_CPNAMES
+# define YYFPRINTF parser_fprintf
+#endif
 
 #endif /* YY_REMAP_H */