[Bug 2315] OpenSSH 6.7p1 on AIX 7.1 compile issue

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Mon Mar 2 06:34:03 AEDT 2015


https://bugzilla.mindrot.org/show_bug.cgi?id=2315

Michael Felt <aixtools at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aixtools at gmail.com

--- Comment #1 from Michael Felt <aixtools at gmail.com> ---
The much easier way is to set CC=xlc before running configure.

By default cc is much closer to c89 (or even pre-c89?) whereas xlc is
much closer to c99.

The key difference, as far as va_copy is concerned is that xlc and it's
derivatives redefine va_copy into a builtin function.

Test program: va_copy_test.c:
===
#include <stdarg.h>

/*
 * test va_copy changes by changing XL C compiler name (cc, c89, c99,
xlc)
 * and the -E flag
 */

va_copy_test(void *a, void *b)
{

#ifdef _ANSI_C_SOURCE
#ifdef _ISOC99_SOURCE
        va_copy(a,b);
#else
        fake_ansi_copy(a,b);
#endif
#endif
#ifndef _ANSI_C_SOURCE
        fake_noansi_copy(a,b);
#endif
}
===
CC=cc
root at x064:[/data/prj/openbsd/openssh]cc -E va_copy_test.c
#line 62 "/usr/include/va_list.h"
typedef char *va_list;
#line 8 "va_copy_test.c"
va_copy_test(void *a, void *b)
{
#line 13
        va_copy(a,b);
#line 21
}
CC=c89
root at x064:[/data/prj/openbsd/openssh]c89 -E va_copy_test.c
#line 62 "/usr/include/va_list.h"
typedef char *va_list;
#line 8 "va_copy_test.c"
va_copy_test(void *a, void *b)
{
#line 15
        fake_ansi_copy(a,b);
#line 21
}
CC=c99
root at x064:[/data/prj/openbsd/openssh]c99 -E va_copy_test.c
#line 62 "/usr/include/va_list.h"
typedef char *va_list;
#line 8 "va_copy_test.c"
va_copy_test(void *a, void *b)
{
#line 13
        __builtin_va_copy(a,b);
#line 21
}
CC=xlc
root at x064:[/data/prj/openbsd/openssh]xlc -E va_copy_test.c
#line 62 "/usr/include/va_list.h"
typedef char *va_list;
#line 8 "va_copy_test.c"
va_copy_test(void *a, void *b)
{
#line 13
        __builtin_va_copy(a,b);
#line 21
}

Although c99 and xlc give the same results - for this - my preference
is to use xlc. Review /etc/vac.cfg.?? and compare c99 with xlc and make
your choice. Saves you a lot of code changes!

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list