diff mbox

Fix libgfortran inquire.c for AIX

Message ID AANLkTikKBxoLVg0OhskzS=do8-Hb5qpMsaVQoum6zUAS@mail.gmail.com
State New
Headers show

Commit Message

David Edelsohn July 31, 2010, 2:46 p.m. UTC
The recent change to inquire.c broke libgfortran on AIX because
string.h was included before io.h.  io.h include libgfortran.h, which
includes config.h and must come first because it can affect system
headers.

The appended patch was bootstrapped on powerpc-ibm-aix5.3.0.0.

Okay?

Thanks, David

       * io/inquire.c: Include io.h before string.h.

Comments

Janne Blomqvist July 31, 2010, 2:59 p.m. UTC | #1
Ok, thanks for the patch.

On Sat, Jul 31, 2010 at 17:46, David Edelsohn <dje.gcc@gmail.com> wrote:
> The recent change to inquire.c broke libgfortran on AIX because
> string.h was included before io.h.  io.h include libgfortran.h, which
> includes config.h and must come first because it can affect system
> headers.
>
> The appended patch was bootstrapped on powerpc-ibm-aix5.3.0.0.
>
> Okay?
>
> Thanks, David
>
>       * io/inquire.c: Include io.h before string.h.
>
> Index: inquire.c
> ===================================================================
> --- inquire.c   (revision 162724)
> +++ inquire.c   (working copy)
> @@ -26,9 +26,9 @@
>
>  /* Implement the non-IOLENGTH variant of the INQUIRY statement */
>
> -#include <string.h>
>  #include "io.h"
>  #include "unix.h"
> +#include <string.h>
>
>
>  static const char undefined[] = "UNDEFINED";
>
Jerry DeLisle July 31, 2010, 3:01 p.m. UTC | #2
On 07/31/2010 07:46 AM, David Edelsohn wrote:
> The recent change to inquire.c broke libgfortran on AIX because
> string.h was included before io.h.  io.h include libgfortran.h, which
> includes config.h and must come first because it can affect system
> headers.
>
> The appended patch was bootstrapped on powerpc-ibm-aix5.3.0.0.
>
> Okay?
>

Yes, please do and thanks for spotting that.

Jerry
diff mbox

Patch

Index: inquire.c
===================================================================
--- inquire.c   (revision 162724)
+++ inquire.c   (working copy)
@@ -26,9 +26,9 @@ 

 /* Implement the non-IOLENGTH variant of the INQUIRY statement */

-#include <string.h>
 #include "io.h"
 #include "unix.h"
+#include <string.h>


 static const char undefined[] = "UNDEFINED";