ATF-devel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Building ATF on OpenBSD box
On Mon, Apr 5, 2010 at 4:00 PM, Sven Dehmlow <sven%kaffeechaoten.de@localhost>
wrote:
> Hey,
Hello Sven,
> I'm trying to build and run ATF 0.7 on OpenBSD (4.6 / i386).
Hmm, I never got to build ATF in OpenBSD (at some point, I think
before 0.7 I even stopped trying). If I recall correctly, it ships
with an old gcc compiler that cannot swallow the C++ constructions in
ATF, and make it work would involve quite a bit of work. But, of
course, I'd love to be proved wrong in this.
[...]
> -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.
Hmm, really? I don't know OpenBSD that much, but enabling such a
thing from the compiler itself would break tons of software...
Actually, in this case, it is the ATF build system the one passing
-Werror explicitly. If it's only warning problems, you can pass
--disable-developer to the configure script to disable most warnings
and the -Werror behavior; that should let you skip through warnings
and only stumble upon real errors. (This is, of course, assuming that
the compiler doesn't enable -Werror by itself as you explain.)
> 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().
Interesting. As you can see, ATF's build system enables a lot of
warning checks by default (see m4/developer-mode.m4), but I never saw
this one in any platform. I'd like to know why gcc in OpenBSD raises
this whereas gcc in other platforms doesn't!
What gcc version does OpenBSD ship with?
As for now, just try passing --disable-developer and see if it builds
at all. If it does, we can address the warnings later :-) If it
doesn't, try to disable warnings explicitly or let us know what the
errors are.
Thanks!
PS: Replying to your other email: yes, you hit another warning related
to C++. I'm not sure why it appears as I think I had disabled that
warning check a while ago...
--
Julio Merino
Home |
Main Index |
Thread Index |
Old Index