Patchwork Fix libgfortran inquire.c for AIX

login
register
mail settings
Submitter David Edelsohn
Date July 31, 2010, 2:46 p.m.
Message ID <AANLkTikKBxoLVg0OhskzS=do8-Hb5qpMsaVQoum6zUAS@mail.gmail.com>
Download mbox | patch
Permalink /patch/60402/
State New
Headers show

Comments

David Edelsohn - July 31, 2010, 2:46 p.m.
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.
Janne Blomqvist - July 31, 2010, 2:59 p.m.
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.
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

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";