This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Assign pointers of different objects to the same pointer
- From: sebastian <sebastian dot bw at freenet dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 6 Jul 2007 13:00:02 +0000
- Subject: Assign pointers of different objects to the same pointer
Is there a possibility to break through the ISO-C++ standard with a
instruction in gcc that let me assign different objects (&Types) to the same
pointer?
Best will be to let allow the declaration of a typeless pointer ( NULL *p; or
NULL p;) that can be assigned with every other pointer of an object (class
initialisation or void members (void FunctionName(void) ).
So only pointers get handled and called and memory(stack) keeps being conform.
So only the functionality of the programme can change on programmer's
mistakes.
Best example is QPointer of QT. QPointer would then be not necessary any more
if ISO-C++ or GCC allow (implement) this.