* [commit/Ada] Remove dead function (extract_string)...
@ 2010-01-12 8:56 Joel Brobecker
2010-01-12 16:19 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2010-01-12 8:56 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 317 bytes --]
I just noticed this unused function in ada-lang.c. It turns out I was
supposed to have deleted it last year, but somehow I forgot.
Fixed thusly.
2010-01-12 Joel Brobecker <brobecker@adacore.com>
Delete dead function.
* ada-lang.c (extract_string): Delete. No longer used.
Checked in.
--
Joel
[-- Attachment #2: extract-string.diff --]
[-- Type: text/x-diff, Size: 1345 bytes --]
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.240
diff -u -p -r1.240 ada-lang.c
--- ada-lang.c 12 Jan 2010 05:48:56 -0000 1.240
+++ ada-lang.c 12 Jan 2010 08:48:43 -0000
@@ -65,8 +65,6 @@
#define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2)
#endif
-static void extract_string (CORE_ADDR addr, char *buf);
-
static void modify_general_field (struct type *, char *, LONGEST, int, int);
static struct type *desc_base_type (struct type *);
@@ -359,25 +357,6 @@ ada_print_array_index (struct value *ind
fprintf_filtered (stream, " => ");
}
-/* Read the string located at ADDR from the inferior and store the
- result into BUF. */
-
-static void
-extract_string (CORE_ADDR addr, char *buf)
-{
- int char_index = 0;
-
- /* Loop, reading one byte at a time, until we reach the '\000'
- end-of-string marker. */
- do
- {
- target_read_memory (addr + char_index * sizeof (char),
- buf + char_index * sizeof (char), sizeof (char));
- char_index++;
- }
- while (buf[char_index - 1] != '\000');
-}
-
/* Assuming VECT points to an array of *SIZE objects of size
ELEMENT_SIZE, grow it to contain at least MIN_SIZE objects,
updating *SIZE as necessary and returning the (new) array. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [commit/Ada] Remove dead function (extract_string)...
2010-01-12 8:56 [commit/Ada] Remove dead function (extract_string) Joel Brobecker
@ 2010-01-12 16:19 ` Tom Tromey
2010-01-12 18:14 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2010-01-12 16:19 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> I just noticed this unused function in ada-lang.c. It turns out I was
Joel> supposed to have deleted it last year, but somehow I forgot.
Adding -Wunused-function to the end of WARN_CFLAGS is interesting.
I see more than a few unused functions -- and this is only looking at
static functions.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [commit/Ada] Remove dead function (extract_string)...
2010-01-12 16:19 ` Tom Tromey
@ 2010-01-12 18:14 ` Joel Brobecker
2010-01-12 19:43 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2010-01-12 18:14 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
> Joel> I just noticed this unused function in ada-lang.c. It turns out I was
> Joel> supposed to have deleted it last year, but somehow I forgot.
>
> Adding -Wunused-function to the end of WARN_CFLAGS is interesting.
> I see more than a few unused functions -- and this is only looking at
> static functions.
I think we should indeed try to enable that warning. I assume it's
just a matter of adding it to
build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
-Wformat-nonliteral -Wno-pointer-sign \
-Wno-unused -Wunused-value -Wno-switch -Wno-char-subscripts"
?
I'll give it a test tomorrow, and send a patch if all is OK.
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [commit/Ada] Remove dead function (extract_string)...
2010-01-12 18:14 ` Joel Brobecker
@ 2010-01-12 19:43 ` Tom Tromey
0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2010-01-12 19:43 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> I think we should indeed try to enable that warning. I assume it's
Joel> just a matter of adding it to
Joel> build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
Joel> -Wformat-nonliteral -Wno-pointer-sign \
Joel> -Wno-unused -Wunused-value -Wno-switch -Wno-char-subscripts"
Joel> ?
Yes, I think that ought to work.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-12 19:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-12 8:56 [commit/Ada] Remove dead function (extract_string) Joel Brobecker
2010-01-12 16:19 ` Tom Tromey
2010-01-12 18:14 ` Joel Brobecker
2010-01-12 19:43 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox