[Xastir-dev] Proposal to clean up some warnings

Jerry Dunmire jerry at dunmire.org
Wed Jun 9 14:36:51 EDT 2010


Hi Curt,
I like the xastir_snprintf() use in most of the cases and it does not
cause any warnings when used to actually instantiate format strings.
And I agree that its use does make the code more bullet proof. The
only problem I'm seeing is the warnings for the specific cases where
it is used to copy strings as I mentioned. There are 124 instances
where xastir_snprintf() is used simply to copy strings.

If you are not seeing the warnings, then there is something different
about our configuration that I'd like to figure that out. I doubt that
it is configuration since I'm using the Ubuntu 10.04 instructions from
the wiki. Specifically, I used the ubuntu-xastir-cvsbuild.sh script to
do the configuration (at least the first time).

I am also using make clean;make.

My suspicion is that I'm using a newer version of GCC (4.4.3), because
I've seen similar increases in warnings on other projects I've been
working with.

...jerry


2010/6/9 Curt, WE7U <curt.we7u at gmail.com>:
> On Wed, 9 Jun 2010, Jerry Dunmire wrote:
>
>> While working on the OSM patch I noticed that the compile produces a
>> lot of warnings and I would like to try and reduce the number a bit.
>>
>> The first one I would like to tackle is:
>>  warning: format not a string literal and no format arguments
>
>> Does anyone have a problem with this change?
>
> Yea, me.  I spent a lot of time adding all the xastir_snprintf()
> stuff a while back to make Xastir much more bulletproof.  There are
> hundreds of those calls that were changed at the time.
>
> I'm not seeing _any_ compiler warnings such as you describe when I
> do a "make clean;make".  What I do see are these, seen when
> compiling on a 64-bit machine:
>
>    warning: cast from pointer to integer of different size
>
> and a small number of these:
>
>    suggest braces around empty body in ‘do’ statement
>
> which are caused by the compiler being stupid.
>
> I suspect what you're seeing are dependent on your particular
> compiler and it's default flags, along with the CFLAGS that Xastir
> uses.  In my case I'm compiling on OpenSuSE-11.1 or 11.2, 64-bit
> x86.  I have a couple of machines still that run 32-bit, similar OS.
>
> --
> Curt, WE7U.                         <http://www.eskimo.com/~archer>
>   APRS:  Where it's at!                    <http://www.xastir.org>
>  Lotto:  A tax on people who are bad at math. - unknown
> Windows:  Microsoft's tax on computer illiterates. - WE7U.
> The world DOES revolve around me:  I picked the coordinate system!"
> _______________________________________________
> Xastir-dev mailing list
> Xastir-dev at lists.xastir.org
> http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir-dev
>
>



More information about the Xastir-dev mailing list