bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc bug causes parted to write bad GPT entries


From: Andreas Dilger
Subject: Re: gcc bug causes parted to write bad GPT entries
Date: Mon, 18 Mar 2002 07:13:20 -0700
User-agent: Mutt/1.3.27i

On Mar 18, 2002  10:36 +0000, Richard Hirst wrote:
> diff -ur parted-1.4.24-1.ori/include/parted/disk_gpt.h 
> parted-1.4.24-1.fix.no-packed/include/parted/disk_gpt.h
> --- parted-1.4.24-1.ori/include/parted/disk_gpt.h     Mon Oct  1 22:06:33 2001
> +++ parted-1.4.24-1.fix.no-packed/include/parted/disk_gpt.h   Mon Mar 18 
> 10:27:54 2002
> @@ -49,7 +49,14 @@
>          uint8_t  clock_seq_hi_and_reserved;
>          uint8_t  clock_seq_low;
>          uint8_t  node[6];
> +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR > 0)
>  } __attribute__ ((packed)) efi_guid_t;
> +#else
> +/* ((packed)) here exposes a bug in older versions of gcc.  Structure is
> + * naturally packed anyway, so it doesn't strictly matter.
> + */
> +} efi_guid_t;
> +#endif

A minor issue, but in general it is better to keep the parenthesis
outside the #ifdef block, so that syntax highlighting and "find matching
parenthesis" work properly.

@@ -49,7 +49,15 @@
         uint8_t  clock_seq_hi_and_reserved;
         uint8_t  clock_seq_low;
         uint8_t  node[6];
-} __attribute__ ((packed)) efi_guid_t;
+}
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR > 0)
+__attribute__ ((packed)) efi_guid_t;
+#else
+/* ((packed)) here exposes a bug in older versions of gcc.  Structure is
+ * naturally packed anyway, so it doesn't strictly matter.
+ */
+efi_guid_t;
+#endif
 
 
 #define UNUSED_ENTRY_GUID    \

Cheers, Andreas
--
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert




reply via email to

[Prev in Thread] Current Thread [Next in Thread]