Hi all,
I've noticed that compilation warnings for regexp.c and wildcard.c are
suppressed by CFLAGS_GNULIB. Removing it expose ftbs caused by both missing
defines for gnulib and compilation warnings (see attached patch). I'm not sure
how we should handle missing defines but I think that we should not suppresed
warnings like it is done now.
Currently only regexp uses gnulib so this problem is not so important, but in
future more modules might start using it and this should be handled somewhat
better. Yet, I'm not sure how.. maybe a wrapper header or CFLAGS_GNULIB_USER
in conf/Makefile.common?
--
Szymon K. Janc
[email protected] // GG: 1383435
=== modified file 'grub-core/Makefile.core.def'
--- grub-core/Makefile.core.def 2010-11-14 22:36:20 +0000
+++ grub-core/Makefile.core.def 2010-11-23 22:05:06 +0000
@@ -429,7 +429,7 @@
common = commands/regexp.c;
common = commands/wildcard.c;
ldadd = libgnulib.a;
- cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
+ cflags = '$(CFLAGS_POSIX)';
cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)';
};
=== modified file 'grub-core/commands/regexp.c'
--- grub-core/commands/regexp.c 2010-09-14 21:06:01 +0000
+++ grub-core/commands/regexp.c 2010-11-24 16:26:24 +0000
@@ -25,6 +25,15 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
#include <grub/script_sh.h>
+
+#ifndef __STRICT_ANSI__
+#define __STRICT_ANSI__ 0
+#endif
+
+#ifndef __STDC_VERSION__
+#define __STDC_VERSION__ 0
+#endif
+
#include <regex.h>
static const struct grub_arg_option options[] =
@@ -87,7 +96,6 @@
static grub_err_t
grub_cmd_regexp (grub_extcmd_context_t ctxt, int argc, char **args)
{
- int argn = 0;
regex_t regex;
int ret;
grub_size_t s;
=== modified file 'grub-core/commands/wildcard.c'
--- grub-core/commands/wildcard.c 2010-09-12 18:15:30 +0000
+++ grub-core/commands/wildcard.c 2010-11-24 16:27:46 +0000
@@ -24,6 +24,14 @@
#include <grub/device.h>
#include <grub/script_sh.h>
+#ifndef __STRICT_ANSI__
+#define __STRICT_ANSI__ 0
+#endif
+
+#ifndef __STDC_VERSION__
+#define __STDC_VERSION__ 0
+#endif
+
#include <regex.h>
static inline int isregexop (char ch);
@@ -266,7 +274,6 @@
const regex_t *regexp)
{
int i;
- int error;
char **files;
unsigned nfile;
char *dir;
@@ -276,7 +283,7 @@
grub_device_t dev;
auto int match (const char *name, const struct grub_dirhook_info *info);
- int match (const char *name, const struct grub_dirhook_info *info)
+ int match (const char *name, const struct grub_dirhook_info *info __attribute__ ((unused)))
{
char **t;
char *buffer;
@@ -440,8 +447,6 @@
else if (*start == '/') /* no device part */
{
- char **r;
- unsigned n;
char *root;
char *prefix;
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel