Bill Hart wrote:
Hi William,

What are the major differences in GCC 4.5.0 which seem to be affecting
Sage? Is there something new that we should be aware of when writing
code for this compiler?

Bill.

I don't know if it is such a good idea worrying about gcc 4.5 just now. Note that the gcc 4.4.4 was released on April 29, 2010 - 15 days *after* gcc 4.5. Perhaps it would be better to wait for gcc 4.5.2 or gcc 4.5.3, when hopefully a few more bugs will have been ironed out.

I don't know how that fits in with William's agreement with the skynet people to ensure Sage builds on the latest gcc, but the latest gcc is 4.4.4, since it was released after gcc 4.5.

If code was written in standard C or C++, following the internationally agreed standards, then it should be immune to changes in compilers. Since Sun Studio is a lot more strict that gcc, then using that to test for portability issues would be sensible. You can install Sun Studio on Linux too.

The fact gcc 4.5 has got stricter is a good thing, but it is still accepting extensions. The recent case of gcc accepting the macro INFINITY even when code was not compiled in C99 mode was just one example. INFINITY was not defined until the C99 standard. This caused problems on Solaris, where the header files strictly adhered to the standards.

I must admit, I find it somewhat annoying that gcc is still not fully C99 compliant, despite it is 12 years since the standard was released! In that time, numerous extensions have been added to gcc, a framework has been added to allow more extensions to be built, but a fairly basic thing, (fully supporting a C standard) has not been implemented.

I also find it annoying that when gcc does finally fully support C99, the default compile mode will be "C99 with gnu extensions". See

http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/C-Dialect-Options.html#C-Dialect-Options

where it says:

`gnu99'
`gnu9x'
GNU dialect of ISO C99. When ISO C99 is fully implemented in GCC, this will become the default. The name `gnu9x' is deprecated.



--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to