how to cast away 'volatile'?

Matthew Woehlke mw_triad@users.sourceforge.net
Mon Mar 12 21:42:00 GMT 2007


Jeffrey Holle wrote:
> Matthew Woehlke wrote:
> 
>>     my_free(void*)bar);
> 
> Should be:
>       my_free((void*)bar);

...excusing the typo. :-) The point was I have tried what you suggested 
(i.e. what I wrote, sans the obvious typo), and I get the same warning.

I'm attaching a file that demonstrates the problem when built with 
'-Wcast-qual'. Note that it builds with the warning (cast.c:8), but no 
errors. (Runs OK too...)

-- 
Matthew
Emacs is a nice OS - but it lacks a good text editor.
That's why I am using Vim.  -- Anonymous
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cast.c
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20070312/b25ee1fd/attachment-0001.c>


More information about the Gcc-help mailing list