This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ... discard qualifiers ...
- To: gcc at gcc dot gnu dot org
- Subject: Re: ... discard qualifiers ...
- From: dlibenzi at maticad dot it (Davide Libenzi)
- Date: Mon, 3 Jan 2000 13:09:33 +0100
On Mon, 03 Jan 2000, llewelly@198.dsl.xmission.com wrote:
> If you are not familiar with the difference between 'const void*',
> 'void const*'and 'void*const' see
> http://www.cerfnet.com/~mpcline/c++-faq-lite/const-correctness.html
> (If you are learning C, and not C++, the const issues are similar, but
> I don't know where to tell you where to look.)
>
> 'typedef void * Pointer' creates an alias for the type 'void*'. In a
> sense, the 'void' and the '*' are globbed together; any type
> qualifiers applied to 'Pointer' apply to 'void*', which is a pointer
> type. So in 'const Pointer' the 'const' applies to the pointer, *not* to
> the object pointed at. Thus, 'const Pointer' ==> 'void* const' ==>
> '(void*) const' (The parantheses are incorrect syntax; they are
> intended only for clarification.).
Perhaps I were not enough clear explaining my problem.
I know the syntax difference from 'const void *' to 'void const *' as long as I
know that if I edit my ( more than 200 K ) lines of code I can fix all my
troubles, but my question were if I can only with another compiler switch other
than 'f-writable-strings'.
Cheers,
Davide.
--
"Debian, the freedom in freedom."