ATF-devel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Building ATF on OpenBSD box



Hey,

I'm trying to build and run ATF 0.7 on OpenBSD (4.6 / i386).

First run with

/configure --prefix=/home/sven/local
make

throws this error:

..
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DATF_ARCH=\"i386\"
-DATF_BUILD_CC=\"gcc\" "-DATF_BUILD_CFLAGS=\"-g -O2  -g -Wall -Wcast-qual
-Werror -Wno-unused-parameter -Wpointer-arith -Wredundant-decls
-Wreturn-type -Wshadow -Wsign-compare -Wswitch -Wwrite-strings
-D_FORTIFY_SOURCE=2 -Wmissing-prototypes -Wno-traditional
-Wstrict-prototypes\"" "-DATF_BUILD_CPP=\"gcc -E\""
-DATF_BUILD_CPPFLAGS=\"\" -DATF_BUILD_CXX=\"g++\"
"-DATF_BUILD_CXXFLAGS=\"-g -O2  -g -Wall -Wcast-qual -Werror
-Wno-unused-parameter -Wpointer-arith -Wredundant-decls -Wreturn-type
-Wshadow -Wsign-compare -Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wabi
-Wctor-dtor-privacy -Wno-deprecated -Wno-non-template-friend
-Wno-pmf-conversions -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder
-Wsign-promo -Wsynth\"" -DATF_CONFDIR=\"/home/sven/local/etc/atf\"
-DATF_INCLUDEDIR=\"/home/sven/local/include\"
-DATF_LIBDIR=\"/home/sven/local/lib\"
-DATF_LIBEXECDIR=\"/home/sven/local/libexec\" -DATF_MACHINE=\"i386\"
-DATF_M4=\"m4\" -DATF_PKGDATADIR=\"/home/sven/local/share/atf\"
-DATF_SHELL=\"/usr/local/bin/bash\" -DATF_WORKDIR=\"/tmp\" -g -O2 -g -Wall
-Wcast-qual -Werror -Wno-unused-parameter -Wpointer-arith
-Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare -Wswitch
-Wwrite-strings -D_FORTIFY_SOURCE=2 -Wmissing-prototypes -Wno-traditional
-Wstrict-prototypes -MT atf-c/tc.lo -MD -MP -MF atf-c/.deps/tc.Tpo -c
atf-c/tc.c -o atf-c/tc.o
atf-c/tc.c:158: warning: duplicate `const'
*** Error code 1

Stop in /home/sven/packages/test/atf-0.7 (line 2971 of Makefile).
*** Error code 1

Stop in /home/sven/packages/test/atf-0.7 (line 1627 of Makefile).
..

Okay, OpenBSD's default is to handle all compiler warnings as errors.

Looking into the code:

tc.c, line 158:
..
atf_error_t
atf_tc_init_pack(atf_tc_t *tc, const atf_tc_pack_t *pack,
                 const atf_map_t *config)
{
    return atf_tc_init(tc, pack->m_ident, pack->m_head, pack->m_body,
                       pack->m_cleanup, config);
}
..

tc.h:
..
typedef const struct atf_tc_pack atf_tc_pack_t;
..

So, the compiler is right: atf_tc_pack_t is already declared as const. No
need for an additional "const" keyword in the parameter list of
atf_tc_init_pack().

I deleted the "const" in the parameter list and afterwards the code in
atf-c compiles just fine.

There are some (perhaps similar) issues with atf-c++. I report those in
another mail ...

Best regards,

Sven


Home | Main Index | Thread Index | Old Index