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

Tom Russo russo at bogodyn.org
Tue Apr 23 20:32:43 PDT 2019


On Tue, Apr 23, 2019 at 09:29:43PM -0600, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
[... SNIP ...]
> 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.

I should also say that after adding these two "ignore warnings" options,
at this point I only get ONE warning from my gcc 8 FreeBSD build:

../../Xastir/src/interface_gui.c: In function 'Config_TNC.part.5':
../../Xastir/src/interface_gui.c:664:17: warning: argument 1 null where non-null
 expected [-Wnonnull]
                 sprintf(tmp, langcode("WPUPCFT029"), (int)device_type);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../Xastir/src/snprintf.h:27,
                 from ../../Xastir/src/interface_gui.c:28:
/usr/include/stdio.h:285:6: note: in a call to function 'sprintf' declared here
 int  sprintf(char * __restrict, const char * __restrict, ...);
      ^~~~~~~
../../Xastir/src/interface_gui.c:664:17: warning: null destination pointer [-Wformat-overflow=]
                 sprintf(tmp, langcode("WPUPCFT029"), (int)device_type);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


This is actually a bug, not a meaningless warning, and is the subject of 
bug #79 on github.  But it's a bug that is almost certainly never tripped,
because the lines in question can't really be reached in actual operation.


> > 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

-- 
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]



More information about the Xastir-dev mailing list