Page MenuHomeFreeBSD

gnu/usr.bin/gdb/libgdb build warning/bug fixes
Needs ReviewPublic

Authored by aprieger_llnw.com on Jun 14 2017, 10:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 26, 3:33 PM
Unknown Object (File)
Sun, Mar 24, 5:56 AM
Unknown Object (File)
Feb 13 2024, 5:41 AM
Unknown Object (File)
Feb 8 2024, 10:18 AM
Unknown Object (File)
Jan 29 2024, 8:52 AM
Unknown Object (File)
Dec 22 2023, 10:05 PM
Unknown Object (File)
Nov 18 2023, 6:39 AM
Unknown Object (File)
Nov 18 2023, 6:30 AM
Subscribers

Details

Reviewers
kbowling
sbruno
Summary

Code changes to fix warnings/bugs during buildtime for the application in the folder gnu/usr.bin/gdb/libgdb

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9989
Build 10416: arc lint + arc unit

Event Timeline

Changelog

  1. 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
  2. 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
  3. contrib/gdb/gdb/breakpoint.c
    • warning: expression result unused [-Wunused-value]
      • fix: removed the unused variable
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. contrib/gdb/gdb/f-valprint.c
    • warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
      • fix: removed the unnecessary parenthesis one line 241
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. contrib/gdb/gdb/remote-utils.c
    • warning: for loop has empty body [-Wempty-body]
      • fix: returned the second semicolon on lines 116, 119, 140
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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

Many more build warnings when built on different targets, will be taken down from review until revised

  • gnu/usr.bin/gdb/libgdb more build warning/bug fixes

In-tree GDB is now disabled by default (rS368441) and will be removed soon