Wasn’t LH_Mouse’s point that even if the warning is explicitly turned on it wouldn’t be shown to the user?
The situation for unions is different in C and C++: (I don’t think that it’s just about constness changes anything) http://stackoverflow.com/questions/11373203 Best, Norbert. Kai Tietz <[email protected]> schrieb am Do., 6. Apr. 2017 um 15:15 Uhr: > 2017-04-06 15:06 GMT+02:00 Liu Hao <[email protected]>: > > On 2017/4/6 20:47, Kai Tietz wrote: > >> True. The reason why we prefer such patter is that it works in both > >> languages as desired. Otherwise we would be in need to write > >> different variants for the languages C/C++. This looks backward, and > >> it still doesn't make sure that there might be warnings emitted for C, > >> or C++ doing const casts. > > The warning about casting away const-ness can be enabled on GCC6 using > > `-Wcast-qual` (I am not sure about other versions). But as long as the > > header file is in a system directory GCC is smart enough to not warn > > about it even if our user enable that warning, unless `-Wsystem-headers` > > is also given. > > > > -- > > Best regards, > > LH_Mouse > > True, that there are flags to turn such warnings off. Each compiler > has its own variants for this. But well, why we should rely on such > things. As you already mentioned, are our headers system ones, and > therefore as silent as possible. Nothing is worse in experience to > users, if they suddenly see warnings, they don't want to see. And > that all because they enabled some warning flags for "their" code. > > Cheers, > Kai > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Mingw-w64-public mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
