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

fix vs2019 warnings: conversion from 'bit' to 'bool' #4379

Closed
wants to merge 2 commits into from

Conversation

gvollant
Copy link
Contributor

when use a bit variable to call function which need a bool, Visual Studio 2019 display:
warning C4244: 'function': conversion from 'bit' to 'bool', possible loss of data

This simple PR just add a (bool) cast

warning C4244:  'function': conversion from 'bit' to 'bool', possible loss of data
@bagder
Copy link
Member

bagder commented Sep 19, 2019

./ftp.c:3609:81: warning: Longer than 79 columns (LONGLINE)
         result = ftp_nb_type(conn, (bool)data->set.prefer_ascii, FTP_RETR_TYPE);

@bagder
Copy link
Member

bagder commented Sep 19, 2019

See also #4189 which is basically a duplicate. Can we first figure out how we can get these warnings to show up in the existing CI builds?

@gvollant
Copy link
Contributor Author

gvollant commented Sep 19, 2019 via email

@gvollant
Copy link
Contributor Author

I'm surprised that checks are not sucessful with only cast

@bagder
Copy link
Member

bagder commented Sep 19, 2019

Looks like the regular false positives we get...

@bagder
Copy link
Member

bagder commented Sep 19, 2019

The coming VS2019 builds in #4383 show the problems this PR aims to fix.

Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of typecasts, but I can't see any better way to address these warnings...

@jay
Copy link
Member

jay commented Sep 19, 2019

try using _Bool for bit type

@bagder
Copy link
Member

bagder commented Sep 20, 2019

That's a good idea!

@bagder bagder changed the title fix warning vs2019 fix vs2019 warnings: conversion from 'bit' to 'bool' Sep 20, 2019
@bagder bagder mentioned this pull request Sep 20, 2019
@bagder bagder closed this in 03ebe66 Sep 21, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants