This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
strict alias analysis question
- From: Manfred Spraul <manfred at colorfullife dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 14 Oct 2003 18:52:20 +0200
- Subject: strict alias analysis question
Hi,
the latest gcc versions generate warnings about potentially dangerous
pointer casts if strict alias analysis is enabled.
Right now two groups of warnings are generated: several from the
inlined MemSet macros:
#define MemSetLoop(start, val, len) \
do \
{ \
int32 * _start = (int32 *) (start); \
int32 * _stop = (int32 *) ((char *) \
_start + (Size) (len)); \
\
while (_start < _stop) \
*_start++ = 0; \
} while (0)
And a few from structures with common headers:
struct hdr {
...;
}
struct b {
struct hdr info;
...
};
void handler(struct hdr* parm)
{
struct b* ptr = (struct b*)parm;
}
Does MemSet break the rules for strict alias analysis? And what about
manual base classes? The actual use it a bit longer (the cast to (Node
*) in src/backend/commands/tablecmds.c generates the warning).
--
Manfred