Increase warning level.
* conf/Makefile.common (CFLAGS_GNULIB): Add -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition. * configure.ac (HOST_CFLAGS): Add bunch of -W arguments. (TARGET_CFLAGS): Likewise. (HOST_CFLAGS): Add -Werror unless --disable-werror is activated. * grub-core/Makefile.core.def (decompressor_xz): Add -Wno-unreachable-code. (normal): Add -Wno-redundant-decls. (xzio): Add -Wno-unreachable-code. (lzopio): Add -Wno-redundant-decls -Wno-error. * grub-core/commands/acpi.c: Add exception to -Wcast-align. * grub-core/commands/lsacpi.c: Add exception to -Wcast-align. * grub-core/gensymlist.sh: Add exception to -Wmissing-format-attribute. * grub-core/kern/dl.c: Add exception to -Wcast-align. * grub-core/kern/efi/efi.c (grub_efi_modules_addr): Likewise. * grub-core/kern/i386/coreboot/init.c: Add exception to -Wsuggest-attribute=noreturn. * grub-core/kern/ia64/dl.c: Add exception to -Wcast-align. * grub-core/kern/ia64/dl_helper.c: Likewise. * grub-core/kern/mips/dl.c: Likewise. * grub-core/kern/sparc64/dl.c: Likewise. * grub-core/lib/LzmaEnc.c: Add exception to -Wshadow. * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy): Likewise. (memcmp): Likewise. * grub-core/lib/pbkdf2.c: Add exception to -Wunreachable-code. * grub-core/loader/ia64/efi/linux.c: Add exception to -Wcast-align. * grub-core/loader/mips/linux.c: Likewise. * grub-core/loader/multiboot_elfxx.c: Likewise. * grub-core/script/parser.y: Add exception to -Wunreachable-code. * grub-core/video/sm712.c: Add exception to -Wcast-align. * util/import_gcry.py: Add -Wno-cast-align to modules checked by hand. * grub-core/font/font.c (grub_font_loader_init): Add explicit cast and fixme. * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Likewise. * grub-core/kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Fix prototype.
This commit is contained in:
parent
37bb97fe9a
commit
ebcecdf1c3
27 changed files with 99 additions and 11 deletions
|
@ -348,7 +348,7 @@ image = {
|
|||
mips_qemu_mips_ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
|
||||
mips_arc_ldflags = '-static-libgcc -Wl,-Ttext,0x8bc00000';
|
||||
ldadd = '-lgcc';
|
||||
cflags = '-static-libgcc';
|
||||
cflags = '-Wno-unreachable-code -static-libgcc';
|
||||
enable = mips;
|
||||
};
|
||||
|
||||
|
@ -1452,7 +1452,7 @@ module = {
|
|||
extra_dist = script/yylex.l;
|
||||
extra_dist = script/parser.y;
|
||||
|
||||
cflags = '$(CFLAGS_POSIX)';
|
||||
cflags = '$(CFLAGS_POSIX) -Wno-redundant-decls';
|
||||
cppflags = '$(CPPFLAGS_POSIX)';
|
||||
};
|
||||
|
||||
|
@ -1737,13 +1737,14 @@ module = {
|
|||
common = lib/xzembed/xz_dec_lzma2.c;
|
||||
common = lib/xzembed/xz_dec_stream.c;
|
||||
cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed';
|
||||
cflags='-Wno-unreachable-code';
|
||||
};
|
||||
|
||||
module = {
|
||||
name = lzopio;
|
||||
common = io/lzopio.c;
|
||||
common = lib/minilzo/minilzo.c;
|
||||
cflags = '$(CFLAGS_POSIX) -Wno-undef';
|
||||
cflags = '$(CFLAGS_POSIX) -Wno-undef -Wno-redundant-decls -Wno-error';
|
||||
cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/minilzo -DMINILZO_HAVE_CONFIG_H';
|
||||
};
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include <grub/efi/api.h>
|
||||
#endif
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static const struct grub_arg_option options[] = {
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include <grub/i18n.h>
|
||||
#include <grub/dl.h>
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static void
|
||||
|
|
|
@ -192,7 +192,8 @@ grub_font_loader_init (void)
|
|||
|
||||
/* Initialize the null font. */
|
||||
font_init (&null_font);
|
||||
null_font.name = "<No Font>";
|
||||
/* FIXME: Fix this slightly improper cast. */
|
||||
null_font.name = (char *) "<No Font>";
|
||||
null_font.ascent = unknown_glyph->height - 3;
|
||||
null_font.descent = 3;
|
||||
null_font.max_char_width = unknown_glyph->width;
|
||||
|
|
|
@ -560,10 +560,11 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
|
|||
{
|
||||
/* The flags are stored at the data position 0, here the
|
||||
filename type is stored. */
|
||||
/* FIXME: Fix this slightly improper cast. */
|
||||
if (entry->data[0] & GRUB_ISO9660_RR_DOT)
|
||||
filename = ".";
|
||||
filename = (char *) ".";
|
||||
else if (entry->data[0] & GRUB_ISO9660_RR_DOTDOT)
|
||||
filename = "..";
|
||||
filename = (char *) "..";
|
||||
else if (entry->len >= 5)
|
||||
{
|
||||
grub_size_t size = 1, csize = 1;
|
||||
|
|
|
@ -41,6 +41,8 @@ cat <<EOF
|
|||
|
||||
#define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; }
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wmissing-format-attribute"
|
||||
|
||||
void
|
||||
grub_register_exported_symbols (void)
|
||||
{
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
|
||||
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
grub_dl_t grub_dl_head = 0;
|
||||
|
||||
static grub_err_t
|
||||
|
|
|
@ -203,6 +203,8 @@ grub_get_rtc (void)
|
|||
return grub_rtc_get_time_ms ();
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
/* Search the mods section from the PE32/PE32+ image. This code uses
|
||||
a PE32 header, but should work with PE32+ as well. */
|
||||
grub_addr_t
|
||||
|
@ -246,6 +248,8 @@ grub_efi_modules_addr (void)
|
|||
return (grub_addr_t) info;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wcast-align"
|
||||
|
||||
char *
|
||||
grub_efi_get_filename (grub_efi_device_path_t *dp)
|
||||
{
|
||||
|
|
|
@ -42,6 +42,8 @@ extern grub_uint8_t _start[];
|
|||
extern grub_uint8_t _end[];
|
||||
extern grub_uint8_t _edata[];
|
||||
|
||||
#pragma GCC diagnostic warning "-Wsuggest-attribute=noreturn"
|
||||
|
||||
grub_uint32_t
|
||||
grub_get_rtc (void)
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ static struct multiboot_info kern_multiboot_info;
|
|||
static grub_uint8_t mmap_entries[sizeof (struct multiboot_mmap_entry) * 32];
|
||||
|
||||
void
|
||||
grub_machine_mmap_init ()
|
||||
grub_machine_mmap_init (void)
|
||||
{
|
||||
if (! startup_multiboot_info)
|
||||
grub_fatal ("Unable to find Multiboot Information (is CONFIG_MULTIBOOT disabled in coreboot?)");
|
||||
|
|
|
@ -39,6 +39,8 @@ grub_arch_dl_check_header (void *ehdr)
|
|||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
#define MASK20 ((1 << 20) - 1)
|
||||
#define MASK19 ((1 << 19) - 1)
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <grub/err.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
void
|
||||
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
|
||||
grub_size_t *got)
|
||||
|
|
|
@ -49,6 +49,8 @@ grub_arch_dl_check_header (void *ehdr)
|
|||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
/* Relocate symbols. */
|
||||
grub_err_t
|
||||
grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
|
||||
|
|
|
@ -38,6 +38,7 @@ grub_arch_dl_check_header (void *ehdr)
|
|||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
/* Relocate symbols. */
|
||||
grub_err_t
|
||||
|
|
|
@ -923,6 +923,8 @@ static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur)
|
|||
|
||||
#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300)
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
|
||||
static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes)
|
||||
{
|
||||
UInt32 numAvailableBytes, lenMain, numDistancePairs;
|
||||
|
|
|
@ -88,6 +88,7 @@ fips_mode (void)
|
|||
}
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
static inline void *
|
||||
memcpy (void *dest, const void *src, grub_size_t n)
|
||||
{
|
||||
|
@ -105,6 +106,7 @@ memcmp (const void *s1, const void *s2, grub_size_t n)
|
|||
{
|
||||
return grub_memcmp (s1, s2, n);
|
||||
}
|
||||
#pragma GCC diagnostic error "-Wshadow"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@ GRUB_MOD_LICENSE ("GPLv2+");
|
|||
desired derived output length DKLEN. Output buffer is DK which
|
||||
must have room for at least DKLEN octets. The output buffer will
|
||||
be filled with the derived data. */
|
||||
#pragma GCC diagnostic ignored "-Wunreachable-code"
|
||||
|
||||
gcry_err_code_t
|
||||
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
|
||||
const grub_uint8_t *P, grub_size_t Plen,
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
#define ALIGN_MIN (256*1024*1024)
|
||||
|
||||
#define GRUB_ELF_SEARCH 1024
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
/* For frequencies. */
|
||||
#include <grub/machine/time.h>
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#define CONCAT(a,b) CONCAT_(a, b)
|
||||
#define CONCAT_(a,b) a ## b
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
/* Check if BUFFER contains ELF32 (or ELF64). */
|
||||
static int
|
||||
CONCAT(grub_multiboot_is_elf, XX) (void *buffer)
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#define YYENABLE_NLS 0
|
||||
|
||||
#include "grub_script.tab.h"
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunreachable-code"
|
||||
%}
|
||||
|
||||
%union {
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
#include "sm712_init.c"
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
#define GRUB_SM712_TOTAL_MEMORY_SPACE 0x700400
|
||||
#define GRUB_SM712_REG_BASE 0x700000
|
||||
#define GRUB_SM712_PCIID 0x0712126f
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue