Page MenuHomeFreeBSD

tcp: tcpdchk & tcpdmatch: warning fixes
ClosedPublic

Authored by aprieger_llnw.com on May 30 2017, 6:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 10 2024, 12:21 PM
Unknown Object (File)
Mar 10 2024, 12:21 PM
Unknown Object (File)
Mar 10 2024, 12:21 PM
Unknown Object (File)
Mar 10 2024, 12:21 PM
Unknown Object (File)
Mar 7 2024, 6:57 PM
Unknown Object (File)
Jan 3 2024, 11:20 AM
Unknown Object (File)
Jan 3 2024, 11:12 AM
Unknown Object (File)
Jan 3 2024, 11:12 AM
Subscribers

Details

Summary

TCP Wrappers: tcpdchk (tcp wrapper configuration checker) and tcpdmatch (tcp wrapper oracle) warning fixes via edits to the C code files

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 9583
Build 10030: arc lint + arc unit

Event Timeline

Changelog:

  1. contrib/tcp_wrappers/fakelog.c
    • Warnings for each of functions: openlog( ), vsyslog( ), VARARGS( ), closelog( )
      • warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
      • warning: control reaches end of non-void function [-Wreturn-type]
    • Fixes:
      • Explicitly added specification of function type to void for each function, suppressing both warnings for each function listed
  2. contrib/tcp_wrappers/inetcf.c
    • Warnings:
      • warning: incompativle redeclaration of library function 'malloc'
      • note: 'malloc' is a builtin with type 'void *(unsigned long)'
      • warning: implicit declaration of function 'check_path' is invalid in C99 [-Wimplicit-function-declaration]
    • Fixes:
      • Removed redeclaration of malloc on line 21
      • Included library <stdlib.h> in the code which contains the malloc( ) function in it's library
      • Included scaffold.h header file in the code that contains check-path( ) function
  3. contrib/tcp_wrappers/scaffold.c
    • Warnings:
      • warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration]
      • note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
    • Fixes:
      • Included <stdlib.h> in the code which contains the exit( ) function in it's library
  4. contrib/tcp_wrappers/tcpdchk.c
    • Warnings:
      • warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration]
      • warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration]
    • Fixes:
      • Included the specific function <getopt.h> library to the code
      • Included<stdlib.h> to the code which contains the atoi( ) function in the library
  5. contrib/tcp_wrappers/tcpdmatch.c
    • Warnings:
      • warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration]
    • Fixes:
      • Included<stdlib.h> to the code which contains the getopt( ) function in the library
vangyzen added inline comments.
contrib/tcp_wrappers/tcpdchk.c
38

POSIX says getopt() is declared by <unistd.h>.

contrib/tcp_wrappers/tcpdmatch.c
34

POSIX says getopt() is declared by <unistd.h>.

  • tcp: tcpdchk & tcpdmatch: changed lib <getopt.h> to <unistd.h>
  1. contrib/tcp_wrappers/tcpdchk.c
    • Replaced the function <getopt.h> with the library containing the function <unistd.h>
  2. contrib/tcp_wrappers/tcpdmatch.c
    • Replaced the function <getopt.h> with the library containing the function <unistd.h>
contrib/tcp_wrappers/tcpdchk.c
38

Thank you for the feedback!

This revision is now accepted and ready to land.May 30 2017, 9:45 PM
This revision was automatically updated to reflect the committed changes.