From: Randy Dunlap <randy.dunlap@xxxxxxxxxx> Fix strict gcc warnings that come from using: ("-Wall -Wp,-D_FORTIFY_SOURCE=2") 83 warnings fixed: sfdisk.c:249: warning: pointer targets in initialization differ in signedness sfdisk.c:376: warning: pointer targets in passing argument 1 of 'chars_to_ulong' differ in signedness sfdisk.c:702: warning: pointer targets in passing argument 1 of 'copy_to_int' differ in signedness sfdisk.c:703: warning: pointer targets in passing argument 1 of 'copy_to_int' differ in signedness sfdisk.c:1709: warning: pointer targets in passing argument 1 of 'fgets' differ in signedness sfdisk.c:1709: warning: pointer targets in assignment differ in signedness sfdisk.c:1714: warning: pointer targets in passing argument 1 of 'index' differ in signedness sfdisk.c:1714: warning: pointer targets in assignment differ in signedness sfdisk.c:1719: warning: pointer targets in passing argument 1 of 'index' differ in signedness sfdisk.c:1719: warning: pointer targets in assignment differ in signedness sfdisk.c:1723: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:1723: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:1723: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:1723: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:1723: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:1723: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:1729: warning: pointer targets in passing argument 1 of 'index' differ in signedness sfdisk.c:1729: warning: pointer targets in assignment differ in signedness sfdisk.c:1739: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:1739: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:1739: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:1739: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:1739: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:1739: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:1739: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:1739: warning: pointer targets in passing argument 1 of 'strncmp' differ in signedness sfdisk.c:2021: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2021: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2021: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2021: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2021: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2021: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2059: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2059: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2059: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2059: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2059: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2059: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2061: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2061: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2061: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2061: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2061: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2061: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2063: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2063: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2063: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2063: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2063: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2063: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2065: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2065: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2065: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2065: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2065: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2065: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2067: warning: pointer targets in passing argument 1 of 'get_ul' differ in signedness sfdisk.c:2083: warning: pointer targets in passing argument 1 of 'get_ul' differ in signedness sfdisk.c:2096: warning: pointer targets in passing argument 1 of 'get_ul' differ in signedness sfdisk.c:2130: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2130: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2130: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2130: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2130: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2130: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2132: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness sfdisk.c:2154: warning: pointer targets in passing argument 1 of 'get_ul' differ in signedness sfdisk.c:2155: warning: pointer targets in passing argument 1 of 'get_ul' differ in signedness sfdisk.c:2156: warning: pointer targets in passing argument 1 of 'get_ul' differ in signedness sfdisk.c:2167: warning: pointer targets in passing argument 1 of 'get_ul' differ in signedness sfdisk.c:2168: warning: pointer targets in passing argument 1 of 'get_ul' differ in signedness sfdisk.c:2169: warning: pointer targets in passing argument 1 of 'get_ul' differ in signedness Signed-off-by: Randy Dunlap <randy.dunlap@xxxxxxxxxx> --- fdisk/sfdisk.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) --- util-linux-ng-2.13.orig/fdisk/sfdisk.c +++ util-linux-ng-2.13/fdisk/sfdisk.c @@ -246,7 +246,7 @@ get_sector(char *dev, int fd, unsigned l static int msdos_signature (struct sector *s) { - unsigned char *data = s->data; + unsigned char *data = (unsigned char *)s->data; if (data[510] == 0x55 && data[511] == 0xaa) return 1; error(_("ERROR: sector %lu does not have an msdos signature\n"), @@ -284,7 +284,8 @@ ulong_to_chars(unsigned long u, char *uu } static unsigned long -chars_to_ulong(unsigned char *uu) { +chars_to_ulong(char *cc) { + unsigned char *uu = (unsigned char *)cc; int i; unsigned long u = 0; @@ -671,7 +672,8 @@ struct partition { /* Unfortunately, partitions are not aligned, and non-Intel machines are unhappy with non-aligned integers. So, we need a copy by hand. */ static int -copy_to_int(unsigned char *cp) { +copy_to_int(char *p) { + unsigned char *cp = (unsigned char *)p; unsigned int m; m = *cp++; @@ -1694,8 +1696,8 @@ struct dumpfld { #define RD_CMD (-2) static int -read_stdin(unsigned char **fields, unsigned char *line, int fieldssize, int linesize) { - unsigned char *lp, *ip; +read_stdin(char **fields, char *line, int fieldssize, int linesize) { + char *lp, *ip; int c, fno; /* boolean true and empty string at start */ @@ -1989,8 +1991,8 @@ build_surrounding_extended(struct part_d static int read_line(int pno, struct part_desc *ep, char *dev, int interactive, struct disk_desc *z) { - unsigned char line[1000]; - unsigned char *fields[11]; + char line[1000]; + char *fields[11]; int fno, pct = pno%4; struct part_desc p, *orig; unsigned long ff, ff1, ul, ml, ml1, def; - To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html