Skip to content

PGCC/NVHPC compiler warning (integer conversion resulted in a change of sign) #39

@johnsonjh

Description

@johnsonjh

A minor thing - I see NVHPC and Portland Group C is reporting a warning (on both Linux/POWER and Linux/x86_64; line numbers below are with PR #36 applied):

pgcc -Wall -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -c -o tcp.o tcp.c
"tcp.c", line 59: warning: integer conversion resulted in a change of sign [integer_sign_change]
        if (tsin->sin_addr.s_addr == -1)
                                     ^

This seems to be an accurate warning: addr was deprecated in favor of aton since passing signed INADDR_NONE (-1) via the return type of in_addr_t (unsigned integer) is system- and compiler-dependent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions