The void** pointer breaking symmetry?
- From: elmar@xxxxxxxxxx
- Date: 5 May 2006 11:44:28 -0700
Hi Clers,
If I look at my ~200000 lines of C code programmed over the past 15
years, there is one annoying thing in this smart language, which
somehow reduces the 'beauty' of the source code ;-):
char *cp;
void *vp;
void **vpp;
// 1
cp=vp;
// 2
cp=*vpp;
Why is the first instruction allowed while the second one creates a
compiler warning/error?
If vpp is a pointer to a void pointer, why am I not allowed to assign
the content of vpp to a char pointer without ugly explicit casts? Why
is it needed to break the symmetry? Are there any GCC compiler options
to specifically disable this warning which doesn't make sense to me?
Thanks for your feedback,
Elmar
P.S.: In case this is an old question: Googles inability to search for
'void**' made it hard to find the answer ;-)
.
- Follow-Ups:
- Re: The void** pointer breaking symmetry?
- From: CBFalconer
- Re: The void** pointer breaking symmetry?
- From: Ben Pfaff
- Re: The void** pointer breaking symmetry?
- From: Eric Sosman
- Re: The void** pointer breaking symmetry?
- From: void * clvrmnky()
- Re: The void** pointer breaking symmetry?
- Prev by Date: Re: How to capture stdout temporarily?
- Next by Date: Re: Efficiency and the proposed changes
- Previous by thread: Search through office files
- Next by thread: Re: The void** pointer breaking symmetry?
- Index(es):
Relevant Pages
|