This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
There should be a warning here. The warning code is confused by the double cast. If you cast directly to short *, you should get the warning.
I'm going to test this patch to fix this problem. Anybody see anything wrong with it?
int main() {
int a = 1; void *p1 = (void *) &a;
* (short *) p1 = 2; char *p2 = (char *) &a;
* (short *) p2 = 3;return a; }
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |