Re: Null pointer dereference and side effects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexandre & Archie,

>I think you really need to make the pointer volatile to prevent the dereference from being optimized out.

Making a pointer volatile:

int * volatile p;


Making what the pointer points to volatile:

volatile int * p;


I presume the former is the prerequisite magic voodoo, and that between the two they may optimize differently. (I haven't actually tested the theory. Just wanted to point it out for Archie.)


Sincerely,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux