[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Type punned-pointers
From: |
Mike |
Subject: |
Re: Type punned-pointers |
Date: |
8 Jun 2006 16:13:18 -0700 |
User-agent: |
G2/0.2 |
> fd_set fdread, fdwrite;
>
> FD_ZERO(&fdread);
>
> FD_ZERO(&fdwrite);
>
> FD_SET(m_IncomingSocket.GetSocket(), &fdread);
>
> FD_SET(m_IncomingSocket.GetSocket(), &fdwrite);
>
> For the last two lines I get the following warning:
>
> warning: dereferencing type-punned pointer will break strict-aliasing rules
> warning: dereferencing type-punned pointer will break strict-aliasing rules
Try renaming fdread and fdwrite; perhaps there are other uses of these
variable names? Otherwise the code looks good, so I don't understand
the compiler warnings.
Mike