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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of "reinterpret_cast: conversion from T to void * of greater size" MSVC warnings #544

Closed
pezcode opened this issue Dec 15, 2021 · 2 comments

Comments

@pezcode
Copy link
Contributor

pezcode commented Dec 15, 2021

This warning keeps showing up in our code, would be nice to have it fixed/silenced for a pristine warning list (at least as far as magnum is concerned 馃槃)

Warning C4312 'reinterpret_cast': conversion from 'T' to 'void *' of greater size

CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format),

@mosra mosra added this to TODO in Project management via automation Dec 15, 2021
@mosra
Copy link
Owner

mosra commented Dec 15, 2021

Yeah I'm aware, and this is far from being the only place. I'm abusing void* to print stuff in hex, basically all enum debug output functions throw the same warning.

This will get all cleaned up once I have Debug::hex / oct / bin / chr / str modifiers implemented. It's bothering me for quite a while but didn't find enough free time to do that yet.

@mosra mosra changed the title Warning in MeshData::checkVertexFormatCompatibility with MSVC Get rid of "reinterpret_cast: conversion from T to void * of greater size" MSVC warnings Jan 21, 2022
@mosra mosra added this to the 2023.0a milestone Mar 5, 2024
@mosra
Copy link
Owner

mosra commented Mar 6, 2024

Debug::hex is implemented in mosra/corrade@718e5fd and is used instead of reinterpret_cast in debug output operators since mosra/corrade@b160eda and 4435877. Accompanying changes in other repos will follow.

I also took this as an opportunity to get rid of hopefully all remaining warnings on MSVC 2017+ in all repos and including tests, so in case you still come across some, don't hesitate to complain :)

@mosra mosra closed this as completed Mar 6, 2024
Project management automation moved this from TODO to Done Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants