Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

GCC's "-fno-strict-aliasing"? (Developers)

posted by RayeR Homepage, CZ, 18.09.2008, 14:10

> As far as I know does the C standard has a few rules about aliassing. An
> alias is e.g. if you have two pointers of different types, then C assumes
> that they can't point to the same memory.

Did you mean something like this?

unsigned long *p1;
unsigned char p2[4]={1,2,3,4};

p1=(unsigned long *)p2;

Is p1 alias of p2? What's wrong on this code? Will it fails to compile if -fno-strict-aliasing enabled? U use such things of retyping very often, eg. when you have a char buffer and you want to access it as a structure.

---
DOS gives me freedom to unlimited HW access.

 

Complete thread:

Back to the forum
Board view  Mix view
22752 Postings in 2119 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum