[Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library

2010-12-27 Thread pogma at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40411

po...@gcc.gnu.org  changed:

   What|Removed |Added

 CC||pogma at gcc dot gnu.org

--- Comment #20 from pogma at gcc dot gnu.org  
2010-12-27 19:17:18 UTC ---
(In reply to comment #19)
> Whether using it is enabled via -std or
> not, linking to values-xpg6.o can cause unexpected behaviour for applications
> or shared objects.

Yes, it can, and that behaviour change is surprising, especially if relinking a
library with a newer gcc (using the same flags as it was linked with using an
older version of the compiler) can cause clients of that library to stop
working or to behave in a different manner.

If a user really wants the xpg6 behaviour from libc they can simply add the
relevant object file to their output or even just define the __xpg4 and __xpg6
symbols in their application, or, as Bruno suggests - use gnulib.


[Bug target/20366] AIX g++ -D_LARGE_FILES fails to compile #include

2010-12-27 Thread pogma at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20366

Peter O'Gorman  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #21 from Peter O'Gorman  2010-12-27 
19:38:47 UTC ---
Fixed since 4.4.0


[Bug target/47032] libgfortran references complex long double functions missing on AIX

2011-02-08 Thread pogma at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47032

Peter O'Gorman  changed:

   What|Removed |Added

 CC||pogma at gcc dot gnu.org

--- Comment #8 from Peter O'Gorman  2011-02-08 
20:43:18 UTC ---
(In reply to comment #7)
> (In reply to comment #3)
> > libgfortran/configure.ac has lines of the form (note I wrapped the line)
> > 
> > AC_CHECK_LIB([m],[copysignl],[AC_DEFINE([HAVE_COPYSIGNL],[1],\
> >[libm includes copysignl])])
> > 
> > So, configure is already checking if libm contains the
> > the "long double functions".  The problem appears to be
> > that AC_CHECK_LIB is a compile only test, and these tests
> > appear to pass on AIX.
> 
> AC_CHECK_LIB uses a link test, not a compile test.

As far as I can tell the problem is that the configure tests for long double
functions don't #include , changing the AC_CHECK_LIB to AC_LINK_IFELSE
that #includes math.h and uses the symbol should give correct results.


[Bug target/47032] libgfortran references complex long double functions missing on AIX

2011-02-08 Thread pogma at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47032

--- Comment #10 from Peter O'Gorman  2011-02-08 
21:03:46 UTC ---
(In reply to comment #9)

> > > > AC_CHECK_LIB([m],[copysignl],[AC_DEFINE([HAVE_COPYSIGNL],[1],\
> > > >[libm includes copysignl])])

> So, for the AC_CHECK_LIB line above, what does the
> AC_LINK_IFELSE patch look like.

Totally untested - something like:

gcc_save_LIBS="$LIBS"
LIBS="$LIBS -lm"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ],[return
(int)copysignl(-1.0,1.0);])],[AC_DEFINE([HAVE_COPYSIGNL],[1],[libm includes
copysignl])])
LIBS="$gcc_save_LIBS"

AIX's math.h has, conditional on 128 bit longdoubles:
#define copysignl(__x, __y) __copysignl128((long double) (__x), (long
double) (__y))

And libm does indeed have a copysignl symbol (but it's missing __copysignl128),
so AC_CHECK_LIB says "yes, libm has copysignl", because it just checks if the
symbol exists in the library. #including math.h and then trying a link test
should give correct results because it will fail to find __copysignl128 in libm