Page MenuHomeFreeBSD

lib/libalias/libalias bug/build warning fixes
Needs ReviewPublic

Authored by aprieger_llnw.com on Jun 23 2017, 5:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 23, 5:34 PM
Unknown Object (File)
Sat, Nov 22, 7:20 PM
Unknown Object (File)
Sat, Nov 22, 9:30 AM
Unknown Object (File)
Tue, Nov 11, 10:59 PM
Unknown Object (File)
Sat, Nov 8, 1:53 AM
Unknown Object (File)
Sat, Nov 1, 4:30 AM
Unknown Object (File)
Sat, Nov 1, 4:30 AM
Unknown Object (File)
Oct 26 2025, 10:28 AM
Subscribers
None

Details

Reviewers
kbowling
sbruno
Summary

Code changes to fix build warnings/bugs for the application built in the lib/libalias/libalias folder

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 10087
Build 10511: arc lint + arc unit

Event Timeline

Changelog:
Pre-fix warnings located at: https://gist.github.com/aprieger-llnw/e21689151f16ceb4aed8bfb4ce031853

  1. sys/netinet/libalias/alias.c
    • warning: cast from 'char *' to 'struct ip *' increases required alignment from 1 to 2 [-Wcast-align]
      • fix: added the (void *) explicit modifier to force alignment on lines 1236, 1255, 1281, 1282, 1324, 1455, 1563
    • taking address of packed member 'ip_dst' of class or structure 'ip' may result in an unaligned pointer value [-Waddress-of-packed-member]
      • fix: created new in_addr variable dst to use in the function in place of the packed member on lines 1371, 1377
    • warning: taking address of packed member 'ip_src' of class or structure 'ip' may result in an unaligned pointer value [-Waddress-of-packed-member]
      • fix: created new in_addr variable src to use in the function in place of the packed member on lines 1525, 1533
  2. sys/netinet/libalias/alias_db.c
    • warning: cast from 'ipfw_insn *' (aka 'struct _ipfw_insn *') to 'ipfw_insn_ip *' (aka 'struct _ipfw_insn_ip *') increases required alignment from 2 to 4 [-Wcast-align]
      • fix: added the (void *) explicit modifier to force alignment on lines 2666, 2698
    • warning: cast from 'ipfw_insn *' (aka 'struct _ipfw_insn *') to 'u_int32_t *' (aka 'unsigned int *') increases required alignment from 2 to 4 [-Wcast-align]
      • fix: added the (void *) explicit modifier to force alignment on lines 2698, 2701
  3. sys/netinet/libalias/alias_proxy.c
    • warning: cast from 'u_char *' (aka 'unsigned char *') to 'u_short *' (aka 'unsigned short *') increases required alignment from 1 to 2 [-Wcast-align]
      • fix: added the (void *) explicit modifier to force alignment on lines 428
  4. sys/netinet/libalias/alias_mod.c
    • warning: no previous extern declaration for non-static variable 'dll_chain' [-Wmissing-variable-declarations]
      • fix: added the (void *) explicit modifier to force alignment on lines 130