[cairo-bugs] [Bug 89354] New: compilation errors on AIX (conflicting types for 'fgetpos64' ...)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Feb 27 01:29:04 PST 2015


https://bugs.freedesktop.org/show_bug.cgi?id=89354

            Bug ID: 89354
           Summary: compilation errors on AIX (conflicting types for
                    'fgetpos64' ...)
           Product: cairo
           Version: unspecified
          Hardware: Other
                OS: AIX
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: chris at chris-wilson.co.uk
          Reporter: michael.haubenwallner at ssi-schaefer.com
        QA Contact: cairo-bugs at cairographics.org

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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20150227/4015439f/attachment.html>


More information about the cairo-bugs mailing list