Hello IBM community,
I keep running into the same problems with AIX. It's always about redefinitions in the system headers. In most cases it comes down to either "conflicting types" or "functions that differ only in their return type cannot be overloaded".
Of course I had a look around and found a bunch of reports in that regard but no good, general answer. I spotted the _LARGE_FILE constants but couldn't find a combination of defines to get rid of the related errors. Using gcc or XL makes no difference. Here are some examples:
/usr/include/sys/mman.h:154:15: error: conflicting types for 'mmap64'
154 | extern void *mmap64(void *, size_t, int, int, int, off64_t);
| ^
/usr/include/sys/mman.h:149:15: note: previous declaration is here
149 | extern void *mmap(void *, size_t, int, int, int, off_t);
| ^
/usr/include/sys/mman.h:89:15: note: expanded from macro 'mmap'
89 | #define mmap mmap64
| ^
/usr/include/sys/lockf.h:64:13: error: conflicting types for 'lockf64'
64 | extern int lockf64 (int, int, off64_t);
| ^
/usr/include/sys/lockf.h:62:13: note: previous declaration is here
62 | extern int lockf (int, int, off_t);
| ^
/usr/include/sys/lockf.h:56:15: note: expanded from macro 'lockf'
56 | #define lockf lockf64
/usr/include/unistd.h:198:25: error: functions that differ only in their return type cannot be overloaded
198 | extern off64_t _NOTHROW(lseek64, (int, off64_t, int));
| ~~~~~~~ ^
/usr/include/comp_macros.h:47:26: note: expanded from macro '_NOTHROW'
47 | #define _NOTHROW(_F, _B) _F _B throw()
| ^
/usr/include/unistd.h:196:23: note: previous declaration is here
196 | extern off_t _NOTHROW(lseek, (int, off_t, int));
| ~~~~~ ^
/usr/include/unistd.h:67:15: note: expanded from macro 'lseek'
67 | #define lseek lseek64
| ^
/usr/include/comp_macros.h:47:26: note: expanded from macro '_NOTHROW'
47 | #define _NOTHROW(_F, _B) _F _B throw()
| ^
/usr/include/unistd.h:918:23: error: conflicting types for 'ftruncate64'
918 | extern int _NOTHROW(ftruncate64, (int, off64_t));
| ^
/usr/include/unistd.h:916:23: note: previous declaration is here
916 | extern int _NOTHROW(ftruncate, (int, off_t));
| ^
/usr/include/unistd.h:840:19: note: expanded from macro 'ftruncate'
840 | #define ftruncate ftruncate64
| ^
/usr/include/unistd.h:975:23: error: conflicting types for 'truncate64'
975 | extern int _NOTHROW(truncate64, (const char *, off64_t));
| ^
/usr/include/unistd.h:973:23: note: previous declaration is here
973 | extern int _NOTHROW(truncate, (const char *, off_t));
| ^
/usr/include/unistd.h:841:18: note: expanded from macro 'truncate'
841 | #define truncate truncate64
| ^
/usr/include/unistd.h:994:18: error: conflicting types for 'pread64'
994 | extern ssize_t pread64(int, void *, size_t, off64_t);
| ^
/usr/include/unistd.h:991:18: note: previous declaration is here
991 | extern ssize_t pread(int, void *, size_t, off_t);
| ^
/usr/include/unistd.h:987:16: note: expanded from macro 'pread'
987 | #define pread pread64
| ^
Any help with sorting these properly would be most welcome!
------------------------------
jack smith
------------------------------
#AIXOpenSource