All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Uninitialized variable
@ 2010-09-23 16:53 Grégoire Sutre
  2010-09-23 22:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Grégoire Sutre @ 2010-09-23 16:53 UTC (permalink / raw)
  To: The development of GRUB 2

Hi,

This is catched (as a warning) by gcc 4.1.3 -- gcc 4.4 does not
complain (maybe some command-line option is missing?).

Grégoire


2010-09-23  Grégoire Sutre  <gregoire.sutre@gmail.com>

	* grub-core/commands/acpihalt.c (get_sleep_type): Initialize prev.

=== modified file 'grub-core/commands/acpihalt.c'
--- grub-core/commands/acpihalt.c	2010-09-13 18:29:15 +0000
+++ grub-core/commands/acpihalt.c	2010-09-23 13:23:46 +0000
@@ -134,11 +134,11 @@ skip_ext_op (const grub_uint8_t *ptr, co
  }

  static int
  get_sleep_type (grub_uint8_t *table, grub_uint8_t *end)
  {
-  grub_uint8_t *ptr, *prev;
+  grub_uint8_t *ptr, *prev = 0;
    int sleep_type = -1;

    ptr = table + sizeof (struct grub_acpi_table_header);
    while (ptr < end && prev < ptr)
      {




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Uninitialized variable
  2010-09-23 16:53 [PATCH] Uninitialized variable Grégoire Sutre
@ 2010-09-23 22:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-09-23 22:39 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1171 bytes --]

On 09/23/2010 06:53 PM, Grégoire Sutre wrote:
> Hi,
>
> This is catched (as a warning) by gcc 4.1.3 -- gcc 4.4 does not
> complain (maybe some command-line option is missing?).
>
> Grégoire
>
>
> 2010-09-23  Grégoire Sutre  <gregoire.sutre@gmail.com>
>
>     * grub-core/commands/acpihalt.c (get_sleep_type): Initialize prev.
>
> === modified file 'grub-core/commands/acpihalt.c'
> --- grub-core/commands/acpihalt.c    2010-09-13 18:29:15 +0000
> +++ grub-core/commands/acpihalt.c    2010-09-23 13:23:46 +0000
> @@ -134,11 +134,11 @@ skip_ext_op (const grub_uint8_t *ptr, co
>  }
>
>  static int
>  get_sleep_type (grub_uint8_t *table, grub_uint8_t *end)
>  {
> -  grub_uint8_t *ptr, *prev;
> +  grub_uint8_t *ptr, *prev = 0;
>    int sleep_type = -1;
>
It should be prev = table; Other than that go ahead.
>    ptr = table + sizeof (struct grub_acpi_table_header);
>    while (ptr < end && prev < ptr)
>      {
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-23 22:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-23 16:53 [PATCH] Uninitialized variable Grégoire Sutre
2010-09-23 22:39 ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.