File pdisk.type-punning.patch of Package pdisk

partition_map.c: In function 'open_partition_map':
partition_map.c:179: warning: dereferencing type-punned pointer will break strict-aliasing rules
partition_map.c: In function 'create_partition_map':
partition_map.c:468: warning: dereferencing type-punned pointer will break strict-aliasing rules
partition_map.c:489: warning: dereferencing type-punned pointer will break strict-aliasing rules

 partition_map.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

Index: pdisk/partition_map.c
===================================================================
--- pdisk.orig/partition_map.c
+++ pdisk/partition_map.c
@@ -121,7 +121,7 @@ open_partition_map(char *name, int *vali
     MEDIA m;
     partition_map_header * map;
     int writeable;
-    int size;
+    long size;
 
     m = open_pathname_as_media(name, (rflag)?O_RDONLY:O_RDWR);
     if (m == 0) {
@@ -173,10 +173,10 @@ open_partition_map(char *name, int *vali
 
     if (ask_logical_size && interactive) {
 	size = PBLOCK_SIZE;
-	printf("A logical block is %d bytes: ", size);
+	printf("A logical block is %ld bytes: ", size);
 	flush_to_newline(0);
 	get_number_argument("what should be the logical block size? ",
-		(long *)&size, size);
+		&size, size);
 	size = (size / PBLOCK_SIZE) * PBLOCK_SIZE;
 	if (size < PBLOCK_SIZE) {
 	    size = PBLOCK_SIZE;
@@ -432,7 +432,7 @@ create_partition_map(char *name, partiti
     DPME *data;
     unsigned long default_number;
     unsigned long number;
-    int size;
+    long size;
     unsigned long multiple;
 
     m = open_pathname_as_media(name, (rflag)?O_RDONLY:O_RDWR);
@@ -462,10 +462,10 @@ create_partition_map(char *name, partiti
     m = open_deblock_media(PBLOCK_SIZE, m);
     map->m = m;
     if (interactive) {
-	printf("A physical block is %d bytes: ", size);
+	printf("A physical block is %ld bytes: ", size);
 	flush_to_newline(0);
 	get_number_argument("what should be the physical block size? ",
-		(long *)&size, size);
+		&size, size);
 	size = (size / PBLOCK_SIZE) * PBLOCK_SIZE;
 	if (size < PBLOCK_SIZE) {
 	    size = PBLOCK_SIZE;
@@ -483,10 +483,10 @@ create_partition_map(char *name, partiti
 	size = PBLOCK_SIZE;
     }
     if (interactive) {
-	printf("A logical block is %d bytes: ", size);
+	printf("A logical block is %ld bytes: ", size);
 	flush_to_newline(0);
 	get_number_argument("what should be the logical block size? ",
-		(long *)&size, size);
+		&size, size);
 	size = (size / PBLOCK_SIZE) * PBLOCK_SIZE;
 	if (size < PBLOCK_SIZE) {
 	    size = PBLOCK_SIZE;
openSUSE Build Service is sponsored by