[GRASS-dev] [GRASS GIS] #3368: warnings and errors in compilation log

GRASS GIS trac at osgeo.org
Sun Jul 23 13:48:32 PDT 2017


#3368: warnings and errors in compilation log
--------------------------+-------------------------
  Reporter:  hellik       |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:  7.4.0
 Component:  Compiling    |    Version:  svn-trunk
Resolution:               |   Keywords:
       CPU:  Unspecified  |   Platform:  All
--------------------------+-------------------------

Comment (by mmetz):

 Replying to [ticket:3368 hellik]:
 > looking into the
 [https://wingrass.fsv.cvut.cz/grass73/x86_64/logs/log-r71243-290/
 package.log] regarding warnings and errors during compilations in windows
 (zipped log file attached), there are some warnings and error (AFAIR I've
 seen them also in my debian 9):

 There will be many more compiler warnings with different compiler flags,
 e.g. -Wall -Wextra -Wpedantic -Wshadow

 As of trunk r71288, some of the warnings have been removed.

 The errors in ctypes parsing C headers seem to be harmless, ctypes is
 apparently working anyway. Getting rid of these error messages would be a
 nice to have.

 About the remaining compiler warnings:

 There are various warnings like

 {{{
 warning: assignment discards 'const' qualifier from pointer target type
 }}}

 These are mostly harmless, it would be nice to get rid of them.

 About iconv

 MS Windows

 {{{
 parser_interface.c: In function 'print_escaped_for_xml':
 parser_interface.c:67:20: warning: passing argument 2 of 'libiconv' from
 incompatible pointer type [-Wincompatible-pointer-types]
   ret = iconv(conv, (char **)&src, &srclen, &dst, &dstlen);
                     ^
 In file included from parser_interface.c:32:0:
 C:/OSGeo4W64/include/iconv.h:87:15: note: expected 'const char **' but
 argument is of type 'char **'
  #define iconv libiconv
                ^
 C:/OSGeo4W64/include/iconv.h:89:37: note: in expansion of macro 'iconv'
  extern LIBICONV_DLL_EXPORTED size_t iconv (iconv_t cd,
                                             const char **inbuf, size_t
 *inbytesleft,
                                             char **outbuf, size_t
 *outbytesleft);
 }}}

 Linux

 {{{
        size_t iconv(iconv_t cd,
                     char **inbuf, size_t *inbytesleft,
                     char **outbuf, size_t *outbytesleft);
 }}}

 We could add `#ifdef __MINGW32__` clauses to avoid these warnings, but the
 both the standard C and the GNU libiconv version expect `char **inbuf`,
 not `const char **inbuf`, therefore I would leave it as it is.

 {{{
 put_row.c: In function 'write_null_bits_compressed':
 put_row.c:509:29: warning: passing argument 1 of 'G_lz4_compress' discards
 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      nwrite = G_lz4_compress(flags, size, compressed_buf, size);
                              ^
 In file included from
 C:/msys64/usr/src/grass_trunk/dist.x86_64-w64-mingw32/include/grass/gis.h:670:0,
                  from
 C:/msys64/usr/src/grass_trunk/dist.x86_64-w64-mingw32/include/grass/raster.h:4,
                  from put_row.c:27:
 C:/msys64/usr/src/grass_trunk/dist.x86_64-w64-mingw32/include/grass/defs/gis.h:208:1:
 note: expected 'unsigned char *' but argument is of type 'const unsigned
 char *'
  G_lz4_compress(unsigned char *src, int src_sz, unsigned char *dst,
  ^
 }}}

 G_compress() and all G_*_compress() functions would need to be changed to
 use const unsingned char *src, same for G_expand() and G_*_expand(). That
 would make sense but is a (probably harmless) API change. Considering that
 GRASS 7.2 is the first release to feature new compression methods, GRASS
 7.2 could be regarded as a tech preview and minor changes in the API
 related to the new feature might be ok.

 `lib/driver/text3.c` same iconv issue as for parser_interface.c

 `lib/cairodriver/text.c` same iconv issue as for parser_interface.c

 {{{
 [...]/include/grass/iostream/empq_adaptive.h: In constructor
 'EMPQueueAdaptive<T, Key>::EMPQueueAdaptive(long int)':
 [...]/include/grass/iostream/empq_adaptive.h:69:47: warning: delegating
 constructors only available with -std=c++11 or -std=gnu++11
    EMPQueueAdaptive(long N) : EMPQueueAdaptive() {};
                                                ^
 }}}

 I guess the c++11 standard should not be a requirement. Any suggestions on
 how to avoid that?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3368#comment:1>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list