[issue14381] Intern certain integral floats for memory savings and performance

Mark Dickinson report at bugs.python.org
Fri Apr 20 11:54:11 CEST 2012


Mark Dickinson <dickinsm at gmail.com> added the comment:

> I declare that this rule does not apply here ...

Clearly the gcc developers disagree. :-)


iwasawa:~ mdickinson$ cat test2.c
int is_positive_zero(double f) {
  return *(long long*)&f == 0;
}
iwasawa:~ mdickinson$ gcc -fstrict-aliasing -O3 -Wall -Wextra -Wstrict-aliasing -c test2.c
test2.c: In function ‘is_positive_zero’:
test2.c:2: warning: dereferencing type-punned pointer will break strict-aliasing rules

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14381>
_______________________________________


More information about the Python-bugs-list mailing list