Page MenuHomeFreeBSD

gnu/usr.bin/gdb build warning fixes
AbandonedPublic

Authored by aprieger_llnw.com on Jun 9 2017, 6:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 25, 1:21 PM
Unknown Object (File)
May 20 2024, 2:26 PM
Unknown Object (File)
May 14 2024, 10:16 PM
Unknown Object (File)
Apr 24 2024, 2:54 AM
Unknown Object (File)
Feb 22 2024, 8:18 AM
Unknown Object (File)
Feb 2 2024, 12:41 PM
Unknown Object (File)
Dec 20 2023, 6:47 AM
Unknown Object (File)
Oct 27 2023, 11:19 AM
Subscribers

Details

Reviewers
kbowling
sbruno
Summary

fixes for warnings during build time for the application in gnu/usr.bin/gdb with the exception of one warning

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 9822
Build 10257: arc lint + arc unit

Event Timeline

Changelog:
Pre-fix warnings are at: https://github.llnw.net/gist/aprieger/25d1af09f4ef0881a2d8

  1. contrib/gdb/gdb/arch-utils.c
    • warning: passing 'bfd_byte *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
      • fix: added the explicit modifier (char *) to parameters on lines 48 and 60
  2. contrib/gdb/gdb/ax-gdb.c
    • warning: 20 enumeration values not handled in switch: 'TYPE_CODE_UNDEF', 'TYPE_CODE_PTR', 'TYPE_CODE_INT'... [-Wswitch]
      • fix: added the default case that simply breaks for the enumeration values on line 745
  3. contrib/gdb/gdb/breakpoint.c
    • warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
      • fix: removed the extra parenthesis for the expressions on lines 2650, 2662
    • warning: expression result unused [-Wunused-value]
      • fix: removed the unused expressions on lines 5546 and 7623
  4. contrib/gdb/gdb/c-typeprint.c
    • warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
      • fix: added the explicit modifier (int) to suppress the warning on line 543

I'm not sure it's worth patching very old contrib code for warning fixes.

contrib/gdb/gdb/breakpoint.c
7622

It seems odd to remove one and not the other. Either both are used (if TARGET_CAN_USE_HARDWARE_WATCHPOINT() expands to is default of invoking the function), or neither is used (if the macro expands to something else as it does for some i386 targets). There is no case where only 'i' is used but not 'mem_cnt'.

contrib/gdb/gdb/c-typeprint.c
543

This would do the wrong thing for a very long array (sizeof(foo[]) > 2^31).