[Xastir-dev] Travis-CI: gcc 8?

Curt Mills curt.we7u at gmail.com
Tue Apr 23 21:21:40 PDT 2019


I'd like to get to the point where we have no or few warnings with no
warnings turned off. It sounds like that might be a while though.

Perhaps we could start with those two extra flags to quiet warnings for the
gcc8/Ubuntu-16.04 build, then think about how to do the string truncation
in a better way and eventually get rid of those extra compile flags.

I remember spending a bunch of hours changing all the snprintf's into
xastir_snprintf's. I could spend a bunch more changing them to something
better, once I know what "better" is.


On Tue, Apr 23, 2019 at 8:42 PM km5vy Tom Russo <russo at bogodyn.org> wrote:

> On Tue, Apr 23, 2019 at 08:35:12PM -0700, we recorded a bogon-computron
> collision of the <curt.we7u at gmail.com> flavor, containing:
> > Your thinking on distributions to drop is sound. It's what I would want
> as
> > well.
> >
> > For the gcc-8 build should we add those two flags as well?
>
> Perhaps, unless you really want to change how we force
> string truncations.  Most of the cases where we're doing strncpy or
> snprintf
> for this purpose makes it look like overkill to be using the string
> functions,
> and in one case I looked at it was like we were using strncpy in a place
> where
> a simple "memcpy" would have been more appropriate.  But there were so many
> of these warnings that I decided just to shut them up with compiler
> options.
> "Fixing" them seemed the lowest priority, since it was warning us that C
> might
> do exactly what we asked it to do, fully expecting it to do so.
>
> Then again, the whole point of this exercise was to quiet down the build by
> making sure we were not making any egregious mistakes, and we have indeed
> found
> some real (if not catastrophic) errors during this process.  So I guess my
> answer is "I dunno."
>
> > On Tue, Apr 23, 2019 at 8:29 PM Tom Russo <russo at bogodyn.org> wrote:
> >
> > > On Tue, Apr 23, 2019 at 09:56:56PM -0500, we recorded a bogon-computron
> > > collision of the <godfreja at gmail.com> flavor, containing:
> > > > I can integrate it. Which build were you thinking of swapping out, or
> > > would
> > > > this be an addition?
> > >
> > > We should probably just drop the Ubuntu 14.04 build altogether.  Ubuntu
> > > 14.04
> > > is past its end of life (as of March 31st), so we shouldn't have to
> waste
> > > resources supporting it.
> > >
> > > Having a 16.04 lite with ImageMagick, 16.04 full with GraphicsMagick
> > > (with stock compiler) and 16.04 full with gcc8 is probably adequate for
> > > Linux testing.  That gets us tested with at least one Linux distro that
> > > isn't
> > > past EOL, and one compiler that is at least close to the cutting edge
> that
> > > will
> > > appear in Linux distros that aren't stodgy.
> > >
> > > If Travis ever starts supporting Ubuntu 18.04, I'd advocate dropping
> all
> > > but
> > > one Ubuntu 16.04 build, then transitioning everything else to the newer
> > > distro.
> > >
> > > I really do agree with Curt that it is worthwhile to add a gcc-8
> build, if
> > > either of you have the time to incorporate it.  I don't have that time.
> > >
> > > I am building with GCC 8 regularly now, and yes, there are "lots" of
> > > warnings,
> > > but most of them are warning us about using strncat, strncpy, snprintf,
> > > and
> > > other such restricted string operators *deliberately* to truncate
> strings
> > > down to a length required by the APRS spec --- these strings *could* be
> > > longer
> > > than the spec, but we truncate down to what we're allowed in a packet.
> > >
> > > GCC 8 warns that these operations "could" truncate the string.  But
> that's
> > > why we're using them.
> > >
> > > I have taken to disabling the two types of warnings that are the
> result of
> > > our
> > > deliberate use of these operators *specifically* to perform
> truncation, by
> > > adding "-Wno-format-truncation -Wno-stringop-truncation" to my CFLAGS.
> > >
> > > It may be reasonable to use some other technique than these operators
> to
> > > copy, say, a maximum of three characters out of a four character string
> > > into a
> > > three character array, but I felt that this warning was OK to ignore
> for
> > > now,
> > > since it's warning us that the operator might do exactly what we
> wanted it
> > > to.
> > >
> > > > On Tue, Apr 23, 2019 at 9:24 PM Curt Mills <curt.we7u at gmail.com>
> wrote:
> > > >
> > > > > I have it building with gcc-8 on Xenial in my topic branch. Xenial
> is
> > > > > Ubuntu-16.04. To get it to work I commented out the other builds
> and
> > > just
> > > > > build with the new one until I could make it work properly. Now I
> don't
> > > > > know how to integrate what I've done with the earlier 4-build
> > > .travis.yml
> > > > > file we have on "master". Want to do the integration? If so I'll
> send
> > > it
> > > > > direct to you. BTW: It's showing LOTS of warnings! For the rest of
> you
> > > out
> > > > > there: That's actually what we want.
> > > > >
> > > > > On Tue, Apr 23, 2019 at 6:47 PM Jason Godfrey <godfreja at gmail.com>
> > > wrote:
> > > > >
> > > > > > Maybe swap the Ubuntu 14.04 max build to use gcc 8 if that is a
> valid
> > > > > > combination? The travis-ci documentation has the comment "If you
> are
> > > on
> > > > > an
> > > > > > open-source plan, please remember that Travis CI provides this
> > > service
> > > > > free
> > > > > > of charge to the community. So please only specify the matrix you
> > > > > *actually
> > > > > > need*."
> > > > > >
> > > > > > On Tue, Apr 23, 2019 at 7:39 PM Curt Mills <curt.we7u at gmail.com>
> > > wrote:
> > > > > >
> > > > > > > We have Xastir building fairly cleanly on Travis-CI with three
> test
> > > > > > cases:
> > > > > > >
> > > > > > > Ubuntu-14.04 max build
> > > > > > > Ubuntu-14.04 min build
> > > > > > > Ubuntu-16.04 max build
> > > > > > >
> > > > > > > Maybe what I should have said is that there aren't any Xastir
> code
> > > > > > > errors/warnings being shown on those three, but a few warnings
> > > appear
> > > > > due
> > > > > > > to problems inside the ImageMagick and Geotiff libraries.
> > > > > > >
> > > > > > > The OSX-10.13.3 build using the "clang" compiler is still
> showing
> > > > > quite a
> > > > > > > few warnings. Looks like really good stuff too as Clang is
> showing
> > > some
> > > > > > > warnings that GCC isn't, and some of them look like real
> problems
> > > in
> > > > > the
> > > > > > > code.
> > > > > > >
> > > > > > > Now... Many of us are running newer OS'es than Ubuntu-16.04,
> but
> > > the
> > > > > list
> > > > > > > of four above (including OSX) are all that are available on
> > > Travis-CI
> > > > > > > currently. Newer OS'es typically have a later release of GCC
> which
> > > > > shows
> > > > > > > more warnings (a good thing).
> > > > > > >
> > > > > > > There's another option for Travis-CI: Create another test case
> > > with a
> > > > > > gcc8
> > > > > > > compiler:
> > > > > > >
> > > > > > > https://docs.travis-ci.com/user/languages/c/#gcc-on-linux
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >
> https://docs.travis-ci.com/user/installing-dependencies/#adding-apt-sources-1
> > > > > > >
> > > > > > > Tom & Jason: interested?
> > > > > > >
> > > > > > > I'm running OpenSuSE-15.0 on my laptop here which has gcc-7.4.0
> > > and it
> > > > > > > shows more errors than the gcc-5.4.0 compiler on the
> Ubuntu-16.04
> > > > > > Travis-CI
> > > > > > > instance. Tom Russo is seeing more as well with his FreeBSD +
> Clang
> > > > > > system.
> > > > > > > --
> > > > > > > Curt, WE7U        http://we7u.wetnet.net
> > > > > > > http://www.sarguydigital.com
> > > > > > > _______________________________________________
> > > > > > > Xastir-dev mailing list
> > > > > > > Xastir-dev at lists.xastir.org
> > > > > > > http://xastir.org/mailman/listinfo/xastir-dev
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > "The problem with quotes on the Internet is that it is often
> > > difficult to
> > > > > > verify their authenticity." - *Abraham Lincoln*
> > > > > > _______________________________________________
> > > > > > Xastir-dev mailing list
> > > > > > Xastir-dev at lists.xastir.org
> > > > > > http://xastir.org/mailman/listinfo/xastir-dev
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Curt, WE7U        http://we7u.wetnet.net
> > > > > http://www.sarguydigital.com
> > > > > _______________________________________________
> > > > > Xastir-dev mailing list
> > > > > Xastir-dev at lists.xastir.org
> > > > > http://xastir.org/mailman/listinfo/xastir-dev
> > > > >
> > > >
> > > >
> > > > --
> > > > "The problem with quotes on the Internet is that it is often
> difficult to
> > > > verify their authenticity." - *Abraham Lincoln*
> > > > _______________________________________________
> > > > Xastir-dev mailing list
> > > > Xastir-dev at lists.xastir.org
> > > > http://xastir.org/mailman/listinfo/xastir-dev
> > >
> > > --
> > > Tom Russo    KM5VY
> > > Tijeras, NM
> > >
> > >  echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z]
> > > [n-z][a-m]
> > >
> > > _______________________________________________
> > > Xastir-dev mailing list
> > > Xastir-dev at lists.xastir.org
> > > http://xastir.org/mailman/listinfo/xastir-dev
> > >
> >
> >
> > --
> > Curt, WE7U        http://we7u.wetnet.net
> http://www.sarguydigital.com
>
> --
> Tom Russo    KM5VY
> Tijeras, NM
>
>  echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z]
> [n-z][a-m]
>
>

-- 
Curt, WE7U        http://we7u.wetnet.net        http://www.sarguydigital.com


More information about the Xastir-dev mailing list