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)
Tue, Mar 31, 7:07 PM
Unknown Object (File)
Mon, Mar 30, 10:16 PM
Unknown Object (File)
Tue, Mar 24, 5:38 PM
Unknown Object (File)
Fri, Mar 20, 11:43 AM
Unknown Object (File)
Mar 2 2026, 8:38 AM
Unknown Object (File)
Mar 2 2026, 2:27 AM
Unknown Object (File)
Jan 16 2026, 9:03 AM
Unknown Object (File)
Jan 8 2026, 2:29 PM
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).