Building coreutils CVS on AIX 4.3 with GCC 4.1 ends with... ----BEGIN---- gcc -std=gnu99 -I. -D_THREAD_SAFE -O0 -g3 -MT readutmp.o -MD -MP -MF .deps/readutmp.Tpo -c -o readutmp.o readutmp.c In file included from readutmp.h:39, from readutmp.c:24: /usr/include/utmpx.h:90: error: redefinition of 'struct utmp_data' In file included from readutmp.c:24: readutmp.h:143: warning: implicit declaration of function 'UT_USER' readutmp.c: In function 'extract_trimmed_name': readutmp.c:55: warning: passing argument 2 of 'strncpy' makes pointer from integer without a cast readutmp.c: In function 'desirable_utmp_entry': readutmp.c:72: error: subscripted value is neither array nor pointer make: 1254-004 The error code from the last command is 1. ----END----
Also, have a look at this excerpt from the configure script output: ----BEGIN---- checking whether getutent is declared... no checking for struct utmpx.ut_user... no checking for struct utmp.ut_user... no checking for struct utmpx.ut_name... no checking for struct utmp.ut_name... no checking for struct utmpx.ut_type... no checking for struct utmp.ut_type... no checking for struct utmpx.ut_pid... no checking for struct utmp.ut_pid... no checking for struct utmpx.ut_id... no checking for struct utmp.ut_id... no checking for struct utmpx.ut_exit... no checking for struct utmp.ut_exit... no checking for struct utmpx.ut_exit.ut_exit... no checking for struct utmp.ut_exit.ut_exit... no checking for struct utmpx.ut_exit.e_exit... no checking for struct utmp.ut_exit.e_exit... no checking for struct utmpx.ut_exit.ut_termination... no checking for struct utmp.ut_exit.ut_termination... no checking for struct utmpx.ut_exit.e_termination... no checking for struct utmp.ut_exit.e_termination... no ----END---- Inspection confirms that both struct utmp and struct utmpx have a .ut_user field, as well as some others in the above list. So what's going on? Look up the utmpx.ut_user check in config.log: ----BEGIN---- configure:34731: checking for struct utmpx.ut_user configure:34760: gcc -std=gnu99 -c -pedantic -pipe -W -Wall -Wcast-align -Wformat=2 -Winline -Wpointer-arith -Wundef -Waggregate-return -Wcast-qual -Wmissing-declarations -Wnested-externs -Wstrict-prototypes -O3 -D_ALL_SOURCE -D_THREAD_SAFE conftest.c >&5 In file included from conftest.c:325: /usr/include/utmp.h:90: error: redefinition of 'struct utmp_data' conftest.c:331: warning: function declaration isn't a prototype configure:34766: $? = 1 configure: failed program was: ----END---- Again, that bit about redefining 'struct utmp_data'. What's going on in that header file? ----BEGIN /usr/include/utmp.h EXCERPT---- #ifdef _THREAD_SAFE struct utmp_data { int ut_fd; long loc_utmp; struct utmp ubuf; char *name; }; #define UTMP_DATA_INIT(__s) (__s.ut_fd=-1, __s.name=UTMP_FILE) #endif /* _THREAD_SAFE */ ----END /usr/include/utmp.h EXCERPT---- The kicker: utmpx.h has that *same exact* fragment as well. Meaning that, if you define _THREAD_SAFE (which the configure script does for you, if it detects an AIX platform), then you can't #include both utmp.h and utmpx.h. A trivial program is enough to confirm this: ----BEGIN---- #define _THREAD_SAFE #include <utmpx.h> #include <utmp.h> int main(void) { return 0; } ----END---- The coreutils build system isn't taking this restriction into account. (Please Cc: any replies to me, as I am not subscribed to this list) --Daniel -- NAME = Daniel Richard G. ## Remember, skunks _\|/_ meef? EMAIL1 = [EMAIL PROTECTED] ## don't smell bad--- (/o|o\) / EMAIL2 = [EMAIL PROTECTED] ## it's the people who < (^),> WWW = http://www.******.org/ ## annoy them that do! / \ -- (****** = site not yet online) _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils