The following commit has been merged in the master branch:
commit 3b9e6070dfe0b2be414fe41fcb8563729c5e62fd
Author: Guillem Jover <[email protected]>
Date:   Wed Nov 21 23:36:10 2012 +0100

    libdpkg: Use uintptr_t instead of char * in STRUCTFIELD cast
    
    This fixes warnings with clang due to a change of alignment
    requirements.

diff --git a/debian/changelog b/debian/changelog
index 9485842..33b45ec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,7 @@ dpkg (1.17.0) UNRELEASED; urgency=low
   * Fix update-alternatives to use the current alternative link as the first
     best value, to avoid flip-flops of alternatives with equal priority.
     Closes: #699807
+  * Fix clang warnings due to change of alignment requirements.
 
  -- Guillem Jover <[email protected]>  Fri, 03 Aug 2012 13:21:00 +0200
 
diff --git a/lib/dpkg/parsedump.h b/lib/dpkg/parsedump.h
index 4074bf4..a3f3eea 100644
--- a/lib/dpkg/parsedump.h
+++ b/lib/dpkg/parsedump.h
@@ -23,6 +23,8 @@
 #ifndef LIBDPKG_PARSEDUMP_H
 #define LIBDPKG_PARSEDUMP_H
 
+#include <stdint.h>
+
 /**
  * @defgroup parsedump In-core package database parsing and reading
  * @ingroup dpkg-public
@@ -76,7 +78,7 @@ typedef void parse_field_func(struct parsedb_state *ps, 
struct field_state *fs,
 bool parse_stanza(struct parsedb_state *ps, struct field_state *fs,
                   parse_field_func *parse_field, void *parse_obj);
 
-#define STRUCTFIELD(klass, off, type) (*(type *)((char *)(klass) + (off)))
+#define STRUCTFIELD(klass, off, type) (*(type *)((uintptr_t)(klass) + (off)))
 
 #define PKGIFPOFF(f) (offsetof(struct pkgbin, f))
 #define FILEFOFF(f) (offsetof(struct filedetails, f))

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to