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)
Fri, Oct 17, 9:52 AM
Unknown Object (File)
Fri, Sep 26, 1:16 PM
Unknown Object (File)
Sep 2 2025, 7:40 PM
Unknown Object (File)
Aug 12 2025, 9:38 PM
Unknown Object (File)
Aug 2 2025, 2:00 AM
Unknown Object (File)
Jul 7 2025, 6:52 AM
Unknown Object (File)
Jul 4 2025, 10:32 PM
Unknown Object (File)
Jul 3 2025, 7:22 PM
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