Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid Compiler warnings #725

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

flichtenheld
Copy link
Member

Try to avoid various compiler warnings both in MinGW and MSVC builds.

openvpn.c:1709:29: warning: ISO C does not support the 'I'
 scanf flag [-Wformat=]
openvpn.c:1709:34: warning: format ‘%u’ expects argument
 of type ‘unsigned int *’, but argument 3 has type
 ‘long long unsigned int *’ [-Wformat=]

Switch to using portable identifiers.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Avoid
warning C4996: '_snwprintf': This function or variable may be unsafe

Also makes the code generally simpler.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Avoid
warning C4996: '_wfopen': This function or variable may be unsafe

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
But avoid -Wcast-function-type (from -Wextra)
since that is not useful for code using
GetProcAddress.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
This happens on newer MinGW versions:
openvpn.c:176:19: error: the comparison will always
evaluate as ‘false’ for the pointer operand in
‘flags + -1’ must not be NULL [-Werror=address]

Strictly speaking this is a false positive, but
the pointer handling is a bit weird, so make the
code more straight-forward.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
tray.c:783:36: error: the comparison will always
evaluate as ‘true’ for the pointer operand [...]
must not be NULL [-Werror=address]

True.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
echo.c:221:72: error: comparison of integer expressions of
different signedness: ‘long unsigned int’ and
‘time_t’ {aka ‘long int’} [-Werror=sign-compare]

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant