From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH 1/3] "-Wall -Wextra -Werror" compilation patches - part 1/3
Date: Wed, 04 Dec 2013 13:33:31 +0100 [thread overview]
Message-ID: <529F211B.9010909@gmail.com> (raw)
In-Reply-To: <1386158288-32144-1-git-send-email-doront@mellanox.com>
[-- Attachment #1: Type: text/plain, Size: 8296 bytes --]
On 04.12.2013 12:58, Doron Tsur wrote:
> Tests: Ubuntu 13.10 compilation
> .../configure --prefix=/usr --enable-mm-debug --enable-cache-stats EFI_ARCH=x86_64 --with-platform=efi --enable-boot-time CFLAGS="-Wall -Wextra -Werror" && make
All of your patches are for external projects (gnulib and libgcrypt). I
suggect contacting them directly. We can backport patches from them but
we don't usually have local patches for their trees.
> Signed-off-by: Doron Tsur <doront@mellanox.com>
> ---
> grub-core/gnulib/argp-fmtstream.c | 2 +-
> grub-core/gnulib/argp-help.c | 6 +++---
> grub-core/gnulib/argp-parse.c | 4 ++--
> grub-core/gnulib/vasnprintf.c | 18 +++++++++++++-----
> grub-core/lib/libgcrypt/cipher/rijndael.c | 3 ++-
> 5 files changed, 21 insertions(+), 12 deletions(-)
>
> diff --git a/grub-core/gnulib/argp-fmtstream.c b/grub-core/gnulib/argp-fmtstream.c
> index 02406ff..19fab18 100644
> --- a/grub-core/gnulib/argp-fmtstream.c
> +++ b/grub-core/gnulib/argp-fmtstream.c
> @@ -234,7 +234,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
> else
> {
> size_t display_width = mbsnwidth (buf, nl - buf, MBSW_STOP_AT_NUL);
> - if (display_width < (ssize_t) fs->rmargin)
> + if (display_width < (size_t) fs->rmargin)
> {
> /* The buffer contains a full line that fits within the maximum
> line width. Reset point and scan the next line. */
> diff --git a/grub-core/gnulib/argp-help.c b/grub-core/gnulib/argp-help.c
> index 2914f47..e01d40c 100644
> --- a/grub-core/gnulib/argp-help.c
> +++ b/grub-core/gnulib/argp-help.c
> @@ -599,8 +599,8 @@ hol_entry_long_iterate (const struct hol_entry *entry,
> \f
> /* Iterator that returns true for the first short option. */
> static int
> -until_short (const struct argp_option *opt, const struct argp_option *real,
> - const char *domain, void *cookie)
> +until_short (const struct argp_option *opt, const struct argp_option *real __attribute__((unused)),
> + const char *domain __attribute__((unused)), void *cookie __attribute__((unused)))
> {
> return oshort (opt) ? opt->key : 0;
> }
> @@ -1269,7 +1269,7 @@ optional for any corresponding short options.");
> static int
> add_argless_short_opt (const struct argp_option *opt,
> const struct argp_option *real,
> - const char *domain, void *cookie)
> + const char *domain __attribute__((unused)), void *cookie)
> {
> char **snao_end = cookie;
> if (!(opt->arg || real->arg)
> diff --git a/grub-core/gnulib/argp-parse.c b/grub-core/gnulib/argp-parse.c
> index 67ea32c..93cce25 100644
> --- a/grub-core/gnulib/argp-parse.c
> +++ b/grub-core/gnulib/argp-parse.c
> @@ -144,7 +144,7 @@ static const struct argp_option argp_version_options[] =
> };
>
> static error_t
> -argp_version_parser (int key, char *arg, struct argp_state *state)
> +argp_version_parser (int key, char *arg __attribute__((unused)), struct argp_state *state)
> {
> switch (key)
> {
> @@ -714,7 +714,7 @@ parser_parse_arg (struct parser *parser, char *val)
> /* Call the user parsers to parse the option OPT, with argument VAL, at the
> current position, returning any error. */
> static error_t
> -parser_parse_opt (struct parser *parser, int opt, char *val)
> +parser_parse_opt (struct parser *parser, int opt, char *val __attribute__((unused)))
> {
> /* The group key encoded in the high bits; 0 for short opts or
> group_number + 1 for long opts. */
> diff --git a/grub-core/gnulib/vasnprintf.c b/grub-core/gnulib/vasnprintf.c
> index 8fdab32..f636389 100644
> --- a/grub-core/gnulib/vasnprintf.c
> +++ b/grub-core/gnulib/vasnprintf.c
> @@ -1532,7 +1532,7 @@ is_borderline (const char *digits, size_t precision)
> of sprintf or SNPRINTF of a single conversion directive. */
> static size_t
> MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
> - arg_type type, int flags, size_t width, int has_precision,
> + arg_type type, int flags __attribute__((unused)), size_t width, int has_precision,
> size_t precision, int pad_ourselves)
> {
> size_t tmp_length;
> @@ -2693,7 +2693,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
> errno = EILSEQ;
> return NULL;
> }
> - if (precision < count)
> + if (precision < (size_t)count)
> break;
> arg_end++;
> characters += count;
> @@ -4606,13 +4606,17 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
> arg_type type = a.arg[dp->arg_index].type;
> int flags = dp->flags;
> #if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
> - int has_width;
> size_t width;
> #endif
> #if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
> int has_precision;
> size_t precision;
> #endif
> +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
> +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
> + int has_width;
> +#endif
> +#endif
> #if NEED_PRINTF_UNBOUNDED_PRECISION
> int prec_ourselves;
> #else
> @@ -4636,7 +4640,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
> #endif
>
> #if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
> +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
> has_width = 0;
> +#endif
> width = 0;
> if (dp->width_start != dp->width_end)
> {
> @@ -4665,7 +4671,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
> width = xsum (xtimes (width, 10), *digitp++ - '0');
> while (digitp != dp->width_end);
> }
> +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
> has_width = 1;
> +#endif
> }
> #endif
>
> @@ -5306,7 +5314,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
> #endif
>
> #if !USE_SNPRINTF
> - if (count >= tmp_length)
> + if ((size_t)count >= tmp_length)
> /* tmp_length was incorrectly calculated - fix the
> code above! */
> abort ();
> @@ -5397,7 +5405,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
>
> #if DCHAR_IS_TCHAR && !USE_SNPRINTF
> /* Make room for the result. */
> - if (count > allocated - length)
> + if ((size_t)count > allocated - length)
> {
> /* Need at least count elements. But allocate
> proportionally. */
> diff --git a/grub-core/lib/libgcrypt/cipher/rijndael.c b/grub-core/lib/libgcrypt/cipher/rijndael.c
> index 4e8eb3a..b79f0ce 100644
> --- a/grub-core/lib/libgcrypt/cipher/rijndael.c
> +++ b/grub-core/lib/libgcrypt/cipher/rijndael.c
> @@ -181,7 +181,8 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
> static int initialized = 0;
> static const char *selftest_failed=0;
> int rounds;
> - int i,j, r, t, rconpointer = 0;
> + int j, r, t, rconpointer = 0;
> + unsigned i = 0;
> int KC;
> union
> {
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]
prev parent reply other threads:[~2013-12-04 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-04 11:58 [PATCH 1/3] "-Wall -Wextra -Werror" compilation patches - part 1/3 Doron Tsur
2013-12-04 11:58 ` [PATCH 2/3] "-Wall -Wextra -Werror" compilation patches - part 2/3 Doron Tsur
2013-12-04 11:58 ` [PATCH 3/3] "-Wall -Wextra -Werror" compilation patches - part 3/3 grub/grub-core/lib/libgcrypt-grub Doron Tsur
2013-12-04 12:33 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=529F211B.9010909@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).