diff mbox

Fix AIX breakage from gcc-ar/nm/ranlib wrappers

Message ID CAGWvnym61aYVW31TZyLXCsstb8z5Ls67+pp-c+ydFmOCCCHnsw@mail.gmail.com
State New
Headers show

Commit Message

David Edelsohn Oct. 30, 2011, 8:39 p.m. UTC
This patch breaks bootstrap on AIX because it includes <stdio.h>
before "config.h".  "config.h" header can affect system headers.  I am
not sure why stdio.h should be included because system.h itself
includes <stdio.h>.  The appended patch moves stdio.h after config.h,
but maybe gcc-ar.h should not include stdio.h explicitly.

Thanks, David

        * gcc-ar.c: Include stdio.h after config.h

Comments

Richard Biener Oct. 30, 2011, 10:01 p.m. UTC | #1
On Sun, Oct 30, 2011 at 9:39 PM, David Edelsohn <dje.gcc@gmail.com> wrote:
> This patch breaks bootstrap on AIX because it includes <stdio.h>
> before "config.h".  "config.h" header can affect system headers.  I am
> not sure why stdio.h should be included because system.h itself
> includes <stdio.h>.  The appended patch moves stdio.h after config.h,
> but maybe gcc-ar.h should not include stdio.h explicitly.

It should indeed not, system headers are supposed to be included from system.h.

A patch that simply removes the include is ok

Thanks,
Richard.

> Thanks, David
>
>        * gcc-ar.c: Include stdio.h after config.h
>
> Index: gcc-ar.c
> ===================================================================
> --- gcc-ar.c    (revision 180685)
> +++ gcc-ar.c    (working copy)
> @@ -18,9 +18,9 @@
>  along with GCC; see the file COPYING3.  If not see
>  <http://www.gnu.org/licenses/>.  */
>
> -#include <stdio.h>
>  #include "config.h"
> +#include <stdio.h>
>  #include "system.h"
>  #include "libiberty.h"
>
>  #ifndef PERSONALITY
>
diff mbox

Patch

Index: gcc-ar.c
===================================================================
--- gcc-ar.c    (revision 180685)
+++ gcc-ar.c    (working copy)
@@ -18,9 +18,9 @@ 
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */

-#include <stdio.h>
 #include "config.h"
+#include <stdio.h>
 #include "system.h"
 #include "libiberty.h"

 #ifndef PERSONALITY