[Swan-dev] "not rocket science" -- master that doesn't fail

Andrew Cagney andrew.cagney at gmail.com
Wed Jan 21 19:53:38 EET 2015


On 21 January 2015 at 12:19, Antony Antony <antony at phenome.org> wrote:
> On Tue, Jan 20, 2015 at 12:40:01PM -0500, Andrew Cagney wrote:
>> [url?]
>>
>> Perhaps a first step would be to include -Werror in the compile flags
>> by default.  Remembering to add a Makefile.inc.local to my tree gets a
>> little tedious :-)
>
> I wonder if libreswan code is ready for -Werror as a default. That might break some builds easily. The last I checked we have a couple warnings when compiling on 32bit ARM.
> https://kojipkgs.fedoraproject.org//packages/libreswan/3.12/1.fc20/data/logs/armv7hl/build.log

You might want to investigate these, this:

/builddir/build/BUILD/libreswan-3.12/programs/pluto/state.c:1319:5:
warning: format '%lu' expects argument of type 'long unsigned int',
but argument 5 has type 'u_int64_t' [-Wformat=]
     sizeof(traffic_buf) - 1, ", type=%s,  add_time=%lu", mode,
st->st_esp.add_time);

for instance, is a bug.

By luck, %ul it is consuming/printing the low 32-bits of a 64-bit
value (I assume fedora-arm is LE).    The high 32-bits will be
consumed by the next format   Consider:

    "add_time=%ul, type=%s", st->st_esp.add_time, mode

the fix, thanks to C99, is just tedium, something like:

   add_time=%" PRIu64, ..., st->st_esp.add_time

> These warnings don't show up on x86_64. May be these are easy to fix, but wonder how easy it is hunt them.

That is because, amd64 has sizeof(long)==8 and not 4.  They should
show up on an i386.

> Also while developing/debugging, sometimes, I want to build ignoring the warnings. That would mean disabling -Werror my Makefile.inc.local :)

Flipping just the -Werror switch should be easy, I guess another todo.

> -antony


More information about the Swan-dev mailing list