<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - compilation errors on AIX (conflicting types for 'fgetpos64' ...)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=89354">89354</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>compilation errors on AIX (conflicting types for 'fgetpos64' ...)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>cairo
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>AIX
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>chris@chris-wilson.co.uk
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>michael.haubenwallner@ssi-schaefer.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>cairo-bugs@cairographics.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In file included from /.../cairo-9999/boilerplate/cairo-boilerplate.h:33,
                 from /.../cairo-9999/test/cairo-test.h:29,
                 from /.../cairo-9999/test/clip-nesting.c:27:
/tools/haubi/.../usr/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/include/stdio.h:542:
error: conflicting types for fgetpos64
/tools/haubi/.../usr/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/include/stdio.h:337:
error: previous declaration of fgetpos64 was here
/tools/haubi/.../usr/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/include/stdio.h:545:
error: conflicting types for fseeko64
/tools/haubi/.../usr/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/include/stdio.h:485:
error: previous declaration of fseeko64 was here
/tools/haubi/.../usr/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/include/stdio.h:546:
error: conflicting types for fsetpos64
/tools/haubi/.../usr/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/include/stdio.h:339:
error: previous declaration of fsetpos64 was here
/tools/haubi/.../usr/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/include/stdio.h:547:
error: conflicting types for ftello64
/tools/haubi/.../usr/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/include/stdio.h:486:
error: previous declaration of ftello64 was here
Makefile:3198: recipe for target cairo_test_suite-clip-nesting.o failed
make[4]: *** [cairo_test_suite-clip-nesting.o] Error 1

Analysis along fgetpos64():

clip-nesting.c        does include <math.h>
<math.h>              does include <standards.h>
<standards.h>         does #define _LARGE_FILE_API
<math.h>              does include <stdlib.h>
<stdlib.h>            does include <sys/wait.h>
<sys/wait.h>          does include <sys/types.h>
<sys/types.h>         does typedef long fpos_t;        //for !_LARGE_FILES
                           typedef long long fpos64_t; //for _LARGE_FILE_API
clip-nesting.c        does include "cairo-test.h"
"cairo-test.h"        does include "cairo-boilerplate.h"
"cairo-boilerplate.h" does include "config.h"
"config.h"            does #define _LARGE_FILES        //too late for fpos_t
"cairo-boilerplate.h" does include <stdio.h>
<stdio.h>             does #define fgetpos fgetpos64   //for _LARGE_FILES
                           declare fgetpos(fpos_t)
                           declare fgetpos64(fpos64_t) //for _LARGE_FILE_API

Resolving defines and typedefs, the conflicting result is:
  extern int fgetpos64(FILE*, long);
  extern int fgetpos64(FILE*, long long);

Root cause is that _LARGE_FILES was not defined before <sys/types.h>,
otherways <sys/types.h> would have done typedef long long fpos_t;

So for AIX it is really important to define ABI-macros (here: _LARGE_FILES)
_before_ including _any_ system header.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>