Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: segfault while saving to png  (Read 5983 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
segfault while saving to png
« Reply #15 on: November 09, 2010, 02:26:51 pm »
Here it is
Quote
I've decided not to fix bugs involving strict-aliasing, because it's just
too much of a hassle. I'll take patches from other people, but I can't
guarantee that I won't break them again, because strict-aliasing
optimizations break too many traditional C programming practices
and in fact make one standard technique I use impossible (I think;
I posted some suggestions on molly rocket for how it might be tackled
in the image writing library, but I don't know if they'll actually work--based
on past experience probably not).

Anyway, I can't test it myself because I don't have a gcc install set up
right now and it's only gcc that does this, and I don't really want to put
effort into setting it up and testing it, because:

I think the gcc developers made a mistake with this; it is allowed
by the C spec, but this is because the C specification is being
developed by people who don't realize the consequences of
this (those people are mostly compiler writers like the gcc authors)
on the ability to write robust C code. No compilers other than gcc do
this (and supposedly Apple turned it off in the gcc that ships with
their OS).

A summary of issues with strict aliasing explaining why we don't
use it at the place where I work:
http://robertoconcerto.blogspot.com/2010/10/strict-aliasing.html

Linus Torvalds explaining why they use -fno-strict-aliasing in the
Linux kernel:
http://lkml.org/lkml/2003/2/26/158

A more general analysis of the problem with compilers gong too far:
http://www.securecoding.cert.org/confluence/download/attachments/26017980/SD+West+Dangerous+Optimizations.pdf?version=1
Laurent Gomila - SFML developer