This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ... discard qualifiers ...
- To: Davide Libenzi <dlibenzi at maticad dot it>
- Subject: Re: ... discard qualifiers ...
- From: <llewelly at 198 dot dsl dot xmission dot com>
- Date: Sun, 2 Jan 2000 13:54:42 -0700 (MST)
- cc: gcc at gcc dot gnu dot org
On Sun, 2 Jan 2000, Davide Libenzi wrote:
>
> Hi guys,
>
> is there a way other than '-fwritable-strings' to avoid errors in this case :
>
> void foo(const void * p)
> {
> ...
> }
>
> main()
> {
>
> foo( "Hello world !" );
>
> }
>
gcc 2.95.2 does not generate any errors for the above code (once the '...'
is commented out); in both C and C++, 'char const*' (the type of a
string literal) can be implicitly converted to 'void const*' (foo's
parameter type).
I don't know what -fwritable-strings has to do with any of this.
Perhaps you need to re-phrase your question.