Skip to content

Don't discard result from QFile::open#261

Merged
danvratil merged 1 commit intoqcoro:mainfrom
nicolasfella:work/nico/discard
Feb 8, 2025
Merged

Don't discard result from QFile::open#261
danvratil merged 1 commit intoqcoro:mainfrom
nicolasfella:work/nico/discard

Conversation

@nicolasfella
Copy link
Contributor

QFile::open is nodiscard in Qt 6.9, breaking the build with -Werror

@danvratil
Copy link
Collaborator

Would you mind changing the name? MSVC doesn't like that it shadows another variable or something of the same name.

D:\a\qcoro\qcoro\examples\background-task\main.cpp(33,20): warning C4456: declaration of 'result' hides previous local declaration [D:\a\qcoro\qcoro\build\examples\background-task\background-task-example.vcxproj]

QFile::open is nodiscard in Qt 6.9, breaking the build with -Werror
@nicolasfella
Copy link
Contributor Author

Would you mind changing the name? MSVC doesn't like that it shadows another variable or something of the same name.

D:\a\qcoro\qcoro\examples\background-task\main.cpp(33,20): warning C4456: declaration of 'result' hides previous local declaration [D:\a\qcoro\qcoro\build\examples\background-task\background-task-example.vcxproj]

Done

@danvratil
Copy link
Collaborator

Thanks!

@danvratil danvratil merged commit 455cb4e into qcoro:main Feb 8, 2025
42 checks passed
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.

2 participants