[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gettext] A couple of warnings during compilation
From: |
Daiki Ueno |
Subject: |
Re: [bug-gettext] A couple of warnings during compilation |
Date: |
Mon, 07 Jan 2013 07:27:05 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
Stefano Lattarini <address@hidden> writes:
> I've just tried bootstrapping and building the gettext master
> with the development version of Automake. Doing so, I have
> noticed a few warnings reported by GCC and GCJ (I've been
> running the compilation rules in "quiet" mode, with "make V=0",
> to have possible warnings stick out more clearly).
>
> Here are the warnings I've noticed:
>
> msgl-fsearch.c:200:3: warning: variably modified ‘short_messages’ \
> at file scope [enabled by default]
For this, I'm about to install the attached patch.
> gcj ./gnu/gettext/DumpResource.java --main=gnu.gettext.DumpResource \
> -o gnu.gettext.DumpResource
> ./gnu/gettext/DumpResource.java:120: warning: Enumeration is a raw type. \
> References to generic type Enumeration<E> should be parameterized
> Enumeration keys = catalog.getKeys();
> ^^^^^^^^^^^
This could be avoided by passing "-fsource=1.3" to gcj, though some old
gcj versions do not have that option. So gt_GCJ (in gettext's gcj.m4)
should take the source_version argument and do some tests like
gt_JAVACOMP (in gnulib's javacomp.m4).
I'll try to implement it, but for a long term, it might be good to move
gcj tests from javacomp.m4 to gcj.m4, and use it from javacomp.m4.
Regards,
--
Daiki Ueno
---
gettext-tools/src/ChangeLog | 8 ++++++++
gettext-tools/src/msgl-fsearch.c | 4 +++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog
index 2faff73..fc37e3f 100644
--- a/gettext-tools/src/ChangeLog
+++ b/gettext-tools/src/ChangeLog
@@ -1,3 +1,11 @@
+2013-01-06 Daiki Ueno <address@hidden>
+
+ * msgl-fsearch.c (message_fuzzy_index_ty): Don't use float-derived
+ integer SHORT_MSG_MAX to define array.
+ (message_fuzzy_index_alloc): Allocate memory for 'short_messages'
+ field dynamically.
+ (message_fuzzy_index_free): Free it.
+
2013-01-03 Daiki Ueno <address@hidden>
* xgettext.c (construct_header): Fix memory leak.
diff --git a/gettext-tools/src/msgl-fsearch.c b/gettext-tools/src/msgl-fsearch.c
index 4cacf39..d2aa865 100644
--- a/gettext-tools/src/msgl-fsearch.c
+++ b/gettext-tools/src/msgl-fsearch.c
@@ -197,7 +197,7 @@ struct message_fuzzy_index_ty
character_iterator_t iterator;
hash_table gram4;
size_t firstfew;
- message_list_ty *short_messages[SHORT_MSG_MAX + 1];
+ message_list_ty **short_messages;
};
/* Allocate a fuzzy index corresponding to a given list of messages.
@@ -304,6 +304,7 @@ message_fuzzy_index_alloc (const message_list_ty *mlp,
findex->firstfew = 10;
/* Setup lists of short messages. */
+ findex->short_messages = XNMALLOC (SHORT_MSG_MAX + 1, message_list_ty *);
for (l = 0; l <= SHORT_MSG_MAX; l++)
findex->short_messages[l] = message_list_alloc (false);
for (j = 0; j < count; j++)
@@ -654,6 +655,7 @@ message_fuzzy_index_free (message_fuzzy_index_ty *findex)
/* Free the short lists. */
for (l = 0; l <= SHORT_MSG_MAX; l++)
message_list_free (findex->short_messages[l], 1);
+ free (findex->short_messages);
/* Free the index lists occurring as values in the hash tables. */
iter = NULL;
--
1.7.10.4
- Re: [bug-gettext] A couple of warnings during compilation,
Daiki Ueno <=