Skip to contentSkip to conversation

multipath-tool: gcc warnings

DISCUSSION Xose Vazquez Perez 3 participants 3 messages Jan 12, 2013 – Jan 14, 2013 Device mapper

lore
Share & tools
lore
#0 lore raw

hi,

I built multipath-tool with -Wextra and gcc shows a lot of warnings. But I believe two of them are relevant:

log_pthread.c:37:3: warning: implicit declaration of function ‘syslog’ [-Wimplicit-function-declaration]
- missing header <syslog.h>

dasd.c:233:4: warning: comparison is always false due to limited range of data type [-Wtype-limits]
- wrong type

#1 lore raw
Quoted 4 lines · Xose Vazquez Perez

hi,

I built multipath-tool with -Wextra and gcc shows a lot of warnings. But I believe two of them are relevant:

...

Quoted 2 lines

dasd.c:233:4: warning: comparison is always false due to limited range of data type [-Wtype-limits]
- wrong type

Stephan,

would you approve this patch to the kpartx dasd parser you contributed back in 2009 ?

kpartx/dasd.h +1 -1
index 0ed7c80..42f94db 100644
@@ -68,7 +68,7 @@ typedef struct volume_label
        char res2[4];           /* reserved                                  */
        char lvtoc[14];         /* owner code for LVTOC                      */
        char res3[28];          /* reserved                                  */
-       char ldl_version;       /* version number, valid for ldl format      */
+       uint8_t ldl_version;    /* version number, valid for ldl format      */
        uint64_t formatted_blocks; /* valid when ldl_version >= f2           */
 } __attribute__ ((packed)) volume_label_t;
 

Best regards,
Christophe Varoqui

#2 lore raw

Christophe Varoqui <[email protected]> wrote on 2013-01-12 20:22:02:

Quoted 31 lines · Xose Vazquez Perez
Quoted 4 lines

hi,

I built multipath-tool with -Wextra and gcc shows a lot of warnings. But I believe two of them are relevant:

...

Quoted 1 line

dasd.c:233:4: warning: comparison is always false due to limited

range of data type [-Wtype-limits]

Quoted 1 line

- wrong type

Stephan,

would you approve this patch to the kpartx dasd parser you contributed back in 2009 ?

kpartx/dasd.h +0 -1
index 0ed7c80..42f94db 100644
@@ -68,7 +68,7 @@ typedef struct volume_label
        char res2[4];           /* reserved   */
        char lvtoc[14];         /* owner code for LVTOC   */
        char res3[28];          /* reserved   */
-       char ldl_version;       /* version number, valid for ldl 

format */
+ uint8_t ldl_version; /* version number, valid for ldl
format */
uint64_t formatted_blocks; /* valid when ldl_version >= f2 */
} __attribute__ ((packed)) volume_label_t;

Quoted 3 lines

Best regards,
Christophe Varoqui

Hi Christophe,

yes,the change looks fine to me, thanks!

Mit freundlichen Grüßen / Kind regards

Stefan Weinhuber

Signature · 15 lines
Linux for zSeries kernel development
IBM Systems &Technology Group, Systems Software Development / SW Linux für 
zSeries Entwicklung

IBM Deutschland
Schoenaicher Str. 220
71032 Boeblingen
Phone: +49-7031-16-4018
E-Mail: [email protected]

IBM Deutschland Research & Development GmbH / Vorsitzender des 
Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, 
HRB 243294