2004-10-06 Paul N. Hilfinger <Hilfinger@gnat.com>
authorPaul N. Hilfinger <hilfinger@adacore.com>
Wed, 6 Oct 2004 09:28:55 +0000 (09:28 +0000)
committerPaul N. Hilfinger <hilfinger@adacore.com>
Wed, 6 Oct 2004 09:28:55 +0000 (09:28 +0000)
* Makefile.in (.l.c): Do conversions of names of alloc and free
functions that are done for .y.c files, plus special one
for yy_flex_realloc.  Also, correct missing-file tests here.
* ada-lex.l (malloc, free): Remove macros.
(resize_tempbuf): Use "realloc"; rely on sed changes to convert to
xrealloc.
(ada_flex_use): Dummy definition to remove warnings about unused
functions.
* ada-exp.y (dummy_string_to_ada_operator): Temporary definition
to suppress warning.

gdb/ChangeLog
gdb/Makefile.in
gdb/ada-exp.y
gdb/ada-lex.l

index 9c27b80..72a2bba 100644 (file)
@@ -1,3 +1,16 @@
+2004-10-06  Paul N. Hilfinger  <Hilfinger@gnat.com>
+
+       * Makefile.in (.l.c): Do conversions of names of alloc and free 
+       functions that are done for .y.c files, plus special one
+       for yy_flex_realloc.  Also, correct missing-file tests here.
+       * ada-lex.l (malloc, free): Remove macros.
+       (resize_tempbuf): Use "realloc"; rely on sed changes to convert to
+       xrealloc.
+       (ada_flex_use): Dummy definition to remove warnings about unused
+       functions.
+       * ada-exp.y (dummy_string_to_ada_operator): Temporary definition
+       to suppress warning.
+       
 2004-10-06  Corinna Vinschen  <vinschen@redhat.com>
 
        * sh-tdep.c (sh_return_value_nofpu): New function, implementing
index 3a4bd37..7593256 100644 (file)
@@ -1582,14 +1582,24 @@ po/$(PACKAGE).pot: force
        -rm $@.tmp
        mv $@.new ./$*.c
 .l.c:
-       @if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \
-           echo $(FLEX) -o$@ $<; \
-           $(FLEX) -o$@ $<; \
-       elif [ ! -f $@ -a ! -f $< ]; then \
-           echo "$< missing and flex not available."; \
-           false; \
-       elif [ ! -f $@ ]; then \
+       if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \
+           $(FLEX) -o$@ $< && \
+           rm -f $@.new && \
+           sed -e '/extern.*malloc/d' \
+               -e '/extern.*realloc/d' \
+               -e '/extern.*free/d' \
+               -e '/include.*malloc.h/d' \
+               -e 's/malloc/xmalloc/g' \
+               -e 's/realloc/xrealloc/g' \
+               -e 's/yy_flex_xrealloc/yyxrealloc/g' \
+             < $@ > $@.new && \
+           rm -f $@ && \
+           mv $@.new $@; \
+       elif [ -f $@ ]; then \
            echo "Warning: $*.c older than $*.l and flex not available."; \
+       else \
+           echo "$@ missing and flex not available."; \
+           false; \
        fi
 
 .PRECIOUS: ada-exp.c ada-lex.c
index 73bd120..936a5a7 100644 (file)
@@ -952,3 +952,13 @@ _initialize_ada_exp (void)
 {
   obstack_init (&temp_parse_space);
 }
+
+/* FIXME: hilfingr/2004-10-05: Hack to remove warning.  The function
+   string_to_operator is supposed to be used for cases where one
+   calls an operator function with prefix notation, as in 
+   "+" (a, b), but at some point, this code seems to have gone
+   missing. */
+
+struct stoken (*dummy_string_to_ada_operator) (struct stoken) 
+     = string_to_operator;
+
index 1087058..e4b8999 100644 (file)
@@ -42,8 +42,6 @@ EXP   (e[+-]{NUM10})
 POSEXP  (e"+"?{NUM10})
 
 %{
-#define malloc xmalloc
-#define free xfree
 
 #define NUMERAL_WIDTH 256
 #define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
@@ -349,7 +347,7 @@ resize_tempbuf (unsigned int n)
   if (tempbufsize < n)
     {
       tempbufsize = (n+63) & ~63;
-      tempbuf = (char *) xrealloc (tempbuf, tempbufsize);
+      tempbuf = (char *) realloc (tempbuf, tempbufsize);
     }
 }
 
@@ -923,3 +921,10 @@ yywrap(void)
 {
   return 1;
 }
+
+/* Dummy definition to suppress warnings about unused static definitions. */
+typedef void (*dummy_function) ();
+dummy_function ada_flex_use[] = 
+{ 
+  (dummy_function) yyrealloc, (dummy_function) yyunput
+};