"Kari Whitcomb" <[EMAIL PROTECTED]> writes:

> After some debugging I've found the culprit behind my unaligned access
> warnings.  The problem lies in the file idom/IDDocumentImpl.cpp in the
> implementation of the allocate function.  The first issue is that the size
> of a pointer is hard coded to be 4 bytes.  This may not be directly
> responsible for my problems but should be changed anyway.  This is simple
> enough to fix with:
> 
> *** IDDocumentImpl.cpp  Wed Aug  1 15:19:13 2001
> --- IDDocumentImpl.cpp.new      Wed Aug  1 15:49:29 2001
> ***************
> *** 884,890 ****
>               fFreePtr = 0;
>               fFreeBytesRemaining = 0;
>           }
> !         void *retPtr = (char *)newBlock + 4;
>           return retPtr;
>       }
> 
> --- 884,890 ----
>               fFreePtr = 0;
>               fFreeBytesRemaining = 0;
>           }
> !         void *retPtr = (char *)newBlock + sizeof(void *);
>           return retPtr;
>       }

This code generates the following message under g++ 2.95.4:

IDDocumentImpl.cpp: In method `void IDDocumentImpl::deleteHeap()':
IDDocumentImpl.cpp:926: warning: `void *' is not a pointer-to-object type
/home/jasons/work/xml-xerces/c/include/util/RefHashTableOf.c: In method `void 
RefHashTableOf<void>::removeBucketElem(const void *, unsigned int &)':
/home/jasons/work/xml-xerces/c/include/util/RefHashTableOf.c:184:   instantiated from 
`RefHashTableOf<void>::removeKey(const void *)'
IDDocumentImpl.cpp:761:   instantiated from here
/home/jasons/work/xml-xerces/c/include/util/RefHashTableOf.c:346: warning: `void *' is 
not a pointer-to-object type
/home/jasons/work/xml-xerces/c/include/util/RefHashTableOf.c: In method `void 
RefHashTableOf<void>::put(void *, void *)':
IDDocumentImpl.cpp:763:   instantiated from here
/home/jasons/work/xml-xerces/c/include/util/RefHashTableOf.c:257: warning: `void *' is 
not a pointer-to-object type

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to