Code changes to fix warnings/bugs during buildtime for the application in the folder gnu/usr.bin/gdb/libgdb
Diff Detail
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 9989 Build 10416: arc lint + arc unit
Event Timeline
Comment Actions
Changelog:
Pre-fix warnings are at: https://gist.github.com/aprieger-llnw/1dfe9bc5edcf0a710f71b02d38f9446e
Comment Actions
Changelog
- contrib/gdb/gdb/amd64fbsd-nat.c
- warning: incompatible pointer to integer conversion assigning to 'CORE_ADDR' (aka 'unsigned long') from 'void *' [-Wint-conversion]
- fix: explicitly casted the parameters of the two variables to (CORE_ADDR) one lines 231 and 232
- warning: incompatible pointer to integer conversion assigning to 'CORE_ADDR' (aka 'unsigned long') from 'void *' [-Wint-conversion]
- contrib/gdb/gdb/amd64-tdep.c
- warning: passing 'unsigned char [3]' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: casted the parameter to (char *) on line 744
- warning: passing 'unsigned char [3]' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/breakpoint.c
- warning: expression result unused [-Wunused-value]
- fix: removed the unused variable
- warning: expression result unused [-Wunused-value]
- contrib/gdb/gdb/cli/cli-setshow.c
- warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (const char *) on line 282
- warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/coff-pe-read.c
- warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (char *) on line 299
- warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (char *) on line 336
- warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/corelow.c
- warning: passing 'const void *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
- fix: explicitly casted the parameter to (char *) on lines 532 and 576
- warning: passing 'const void *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
- contrib/gdb/gdb/c-typeprint.c
- warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
- fix: removed the first part of the condition, as it is uneeded
- warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
- contrib/gdb/gdb/dwarf2expr.c
- warning: 154 enumeration values not handled in switch: 'DW_OP_addr', 'DW_OP_const1u', 'DW_OP_const1s'... [-Wswitch]
- fix: added a default case to end of switch statement on line 565
- warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameters to (unsigned char *) on lines 531, 532, 544, 545
- warning: 154 enumeration values not handled in switch: 'DW_OP_addr', 'DW_OP_const1u', 'DW_OP_const1s'... [-Wswitch]
- contrib/gdb/gdb/dwarf2-frame.c
- warning: passing 'long *' to parameter of type 'unsigned long *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameters to (unsigned long *) on line 396
- warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (unsigned char *) on lines 1339, 1381, 1382, 1440, 1441
- warning: unsequenced modification and access to 'buf' [-Wunsequenced]
- fix: moved the incrementation of buf one lines down one line 1364
- warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (char *) on lines 1376
- warning: passing 'long *' to parameter of type 'unsigned long *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/dwarf2loc.c
- warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the LHS to (unsigned char *) on line 164, 315, 531, 578
- warning: assigning to 'bfd_byte *' (aka 'unsigned char *') from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (bfd_byte *) on line 241
- warning: passing 'bfd_byte *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (char *) on line 254
- warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (char *) on line 65 and 66
- warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (unsigned char *) on lines 70 and 72
- warning: passing 'unsigned int *' to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (int *) on lines 70 and 72
- warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/dwarf2read.c
- warning: passing 'unsigned int *' to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (int *) on lines 4586, 5416, 7554
- warning: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (unsigned int *) on lines 5260, 5268, 5273, 5275, 5277, 5416, 7554, 7974, 7976, 8001, 8003, 8053, 8055
- warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (unsigned char *) on lines 8092 and 8117
- warning: passing 'unsigned int *' to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/f-exp.y
- warning: enumeration values 'tp_const', 'tp_volatile', and 'tp_space_identifier' not handled in switch [-Wswitch]
- fix: added the default case to the switch on line 541
- warning: enumeration values 'tp_const', 'tp_volatile', and 'tp_space_identifier' not handled in switch [-Wswitch]
- contrib/gdb/gdb/f-typeprint.c
- warning: enumeration values 'TYPE_CODE_TEMPLATE', 'TYPE_CODE_TEMPLATE_ARG', and 'TYPE_CODE_NAMESPACE' not handled in switch [-Wswitch]
- fix: added the default case to the switch on line 149 and 261
- warning: enumeration values 'TYPE_CODE_TEMPLATE', 'TYPE_CODE_TEMPLATE_ARG', and 'TYPE_CODE_NAMESPACE' not handled in switch [-Wswitch]
- contrib/gdb/gdb/f-valprint.c
- warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
- fix: removed the unnecessary parenthesis one line 241
- warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
- contrib/gdb/gdb/gdb-events.c
- warning: enumeration value 'nr_gdb_events' not handled in switch [-Wswitch]
- fix: added the default case in the switch on line 407
- warning: enumeration value 'nr_gdb_events' not handled in switch [-Wswitch]
- contrib/gdb/gdb/gnu-v3-abi.c
- warning: incompatible pointer types assigning to 'enum dtor_kinds (*)(const char *)' from 'enum gnu_v3_dtor_kinds (const char *)' [-Wincompatible-pointer-types]
- fix: explicitly casted the parameter to (enum ctor_kinds (*)(const char *)) on lines 430 and 431
- warning: incompatible pointer types assigning to 'enum dtor_kinds (*)(const char *)' from 'enum gnu_v3_dtor_kinds (const char *)' [-Wincompatible-pointer-types]
- contrib/gdb/gdb/i386-tdep.c
- warning: passing 'unsigned char [4]' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (char *) on lines 404
- warning: passing 'unsigned char [8]' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (char *) on lines 458
- warning: passing 'unsigned char [4]' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/i387-tdep.c
- warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (char *) on lines 100 and 104
- warning: passing 'const char *' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (const unsigned char *) on lines 586
- warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/linespec.c
- warning: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (unsigned int *) on 1092, 1099
- warning: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/osabi.c
- warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (const char *) on 577
- warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/p-typeprint.c
- warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
- fix: removed the unnecessary condition on line 267
- warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
- contrib/gdb/gdb/regcache.c
- warning: assigning to 'signed char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (signed char *) on 577
- warning: assigning to 'signed char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/remote.c
- warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (unsigned char *) on 1423, 2968, 3156, 3164
- warning: passing 'unsigned int *' to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (int*) on line 1529,
- warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (char *) on line 2896, 2912, 2959, 2968, 3030, 3086, 3101, 3147, 3156, 3219, 3661, 3669, 3708, 3716, 3726, 3727
- warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (const char *) on line 2941, 2944, 2952, 2957, 2963, 2964, 2695, 2974, 2992, 3130, 3133, 3141, 3145, 3151, 3152, 3153, 3162, 3180
- warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
- fix: added parentheses to clarify the if condition on line 3130
- warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (char *) on line 3162
- warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/remote-utils.c
- warning: for loop has empty body [-Wempty-body]
- fix: returned the second semicolon on lines 116, 119, 140
- warning: for loop has empty body [-Wempty-body]
- contrib/gdb/gdb/ser-tcp.c
- warning: passing 'int *' to parameter of type 'socklen_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (socklen_t *) on line 168
- warning: passing 'int *' to parameter of type 'socklen_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/symfile.c
- warning: passing 'char [8192]' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (unsigned char *) on line 1025
- warning: 10 enumeration values not handled in switch: 'language_unknown', 'language_auto', 'language_objc'... [-Wswitch]
- fix: added the default case to the switch on line 2645
- warning: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (unsigned int *) on line 3340 and 3402
- warning: passing 'char [8192]' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/target.c
- warning: enumeration value 'MEM_RW' not handled in switch [-Wswitch]
- fix: added the default case to the switch on line 965, 1045
- warning: enumeration value 'MEM_RW' not handled in switch [-Wswitch]
- fix: added the default case to the switch on line 1045
- warning: passing 'unsigned char [16]' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameter to (char *) on line 1785
- warning: enumeration value 'MEM_RW' not handled in switch [-Wswitch]
- contrib/gdb/gdb/tracepoint.c
- warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the RHS to (char *) on line 1440
- warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
- contrib/gdb/gdb/tui/tui-stack.c
- warning: incompatible integer to pointer conversion passing 'CORE_ADDR' (aka 'unsigned long') to parameter of type 'CORE_ADDR *' (aka 'unsigned long *') [-Wint-conversion]
- fix: changes the explicit cast from (CORE_ADDR) to (CORE_ADDR *) on line 359
- warning: incompatible integer to pointer conversion passing 'CORE_ADDR' (aka 'unsigned long') to parameter of type 'CORE_ADDR *' (aka 'unsigned long *') [-Wint-conversion]
- contrib/gdb/gdb/utils.c
- warning: passing 'unsigned int *' to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- fix: explicitly casted the parameters to (int *) on line 1721
- warning: passing 'unsigned int *' to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign]
- gnu/usr.bin/gdb/libgdb/fbsd-threads.c
- warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
- fix: explicitly casted the parameters to (int) on lines 1026 and 1040
- warning: format string is not a string literal (potentially insecure) [-Wformat-security]
- fix: added the print format modifier “%s” on lines 644 and 647
- warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
Comment Actions
Many more build warnings when built on different targets, will be taken down from review until revised