[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Everyone working on the C side might want to read this article...
From: |
Rob Browning |
Subject: |
Everyone working on the C side might want to read this article... |
Date: |
Thu, 17 Apr 2003 15:00:22 -0500 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu) |
The following article explains gcc changes that may be behind at least
some of our recent set of bugs:
http://www.ddj.com/documents/s=880/ddj0010d/0010d.htm
You may not need to read it if you're already familiar with what the C
standard says about type aliasing, or already know that (for example)
according to the standard this code is illegal and the results are
undefined:
double d = 3.0;
int* ip = (int*) &d;
*ip = 7;
or if you know that an optimizer is within its rights according to the
standard to translate this:code:
double d = 2.0;
int *ip = (int*) &d;
*ip = 3;
d *= 2;
into this code:
double d = 2.0;
int *ip = (int*) &d;
d *= 2;
*ip = 3;
Thanks to Marius for tracking the pointer down. I'm not yet sure what
this means for our code.
--
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
- Everyone working on the C side might want to read this article...,
Rob Browning <=