Skip to content

AIX 32 bit build is broken #18510

@andrewkirillov-ibm

Description

@andrewkirillov-ibm

I did this

I was building 8.16.0 release on AIX in 32 bit mode and the build failed (64 bit build is good):

  CC       libcurl_la-altsvc.lo
altsvc.c:230:8: error: call to undeclared library function 'fopen' with type 'FILE *(const char *, const char *)'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
  fp = fopen(file, FOPEN_READTEXT);
       ^
altsvc.c:230:8: note: include the header <stdio.h> or explicitly provide a declaration for 'fopen'

The problem is very similar to the issue raised yesterday: #18500

So it looks like for 32 bit builds, the _LARGE_FILES is defined in system headers. And then checking /usr/include/stdio.h we find this:

#ifdef _LARGE_FILES
#define fseeko fseeko64
#define ftello ftello64
#define fgetpos fgetpos64
#define fsetpos fsetpos64
#define fopen fopen64
#define freopen freopen64
#endif /* _LARGE_FILES */

So when doing 32 bit build, fopen becomes a #define.

And now we get back to same problem as yesterday. stdio.h is included from curl_setup.h. At the end of curl_setup.h we include curl_mem_undef.h. And here we do #undef fopen.

I expected the following

I expect a clean build.

curl/libcurl version

curl 8.16.0 tag

operating system

AIX 7.2.5
Only when building in 32 bit mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions