[Git][debian-gis-team/proj][master] 2 commits: Add upstream patches to fix test failure with GCC 8.x.

Bas Couwenberg gitlab at salsa.debian.org
Sat Aug 11 14:56:58 BST 2018


Bas Couwenberg pushed to branch master at Debian GIS Project / proj


Commits:
5d3855d7 by Bas Couwenberg at 2018-08-11T13:47:32Z
Add upstream patches to fix test failure with GCC 8.x.

- - - - -
e7cf9643 by Bas Couwenberg at 2018-08-11T13:47:48Z
Set distribution to unstable.

- - - - -


5 changed files:

- debian/changelog
- + debian/patches/0001-4D-API_cs2cs-style.gie-rewrite-test-to-not-rely-on-p.patch
- + debian/patches/0001-Fix-wrong-behaviour-of-torad_coord-with-gcc-8.1-O2-f.patch
- + debian/patches/0001-projects.h-use-param-variable-length-member-syntax-w.patch
- + debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,13 @@
-proj (5.1.0-2) UNRELEASED; urgency=medium
+proj (5.1.0-2) unstable; urgency=medium
 
   * Bump Standards-Version to 4.2.0, no changes.
   * Use filter instead of findstring to prevent partial matches.
   * Update lintian override for embedded-javascript-library.
   * Drop autopkgtest to test installability.
   * Add lintian override for testsuite-autopkgtest-missing.
+  * Add upstream patches to fix test failure with GCC 8.x.
 
- -- Bas Couwenberg <sebastic at debian.org>  Thu, 05 Jul 2018 10:56:56 +0200
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 11 Aug 2018 15:47:39 +0200
 
 proj (5.1.0-1) unstable; urgency=medium
 


=====================================
debian/patches/0001-4D-API_cs2cs-style.gie-rewrite-test-to-not-rely-on-p.patch
=====================================
--- /dev/null
+++ b/debian/patches/0001-4D-API_cs2cs-style.gie-rewrite-test-to-not-rely-on-p.patch
@@ -0,0 +1,24 @@
+Description: 4D-API_cs2cs-style.gie: rewrite test to not rely on presence of
+ 'conus' grid (we should have a way to state that some grids must be present)
+ (refs #872)
+Author: Even Rouault <even.rouault at spatialys.com>
+Origin: https://github.com/OSGeo/proj.4/commit/666efb98088c007fc297e8cbd0648367bd62c014
+
+--- a/test/gie/4D-API_cs2cs-style.gie
++++ b/test/gie/4D-API_cs2cs-style.gie
+@@ -235,12 +235,12 @@ Test that +datum parameters are handled
+ See #872 for details.
+ -------------------------------------------------------------------------------
+ operation   +proj=pipeline
+-            +step +proj=longlat +datum=NAD27 +inv
++            +step +proj=longlat +datum=GGRS87 +inv
+             +step +proj=longlat +datum=WGS84
+ -------------------------------------------------------------------------------
+ tolerance   20 cm
+-accept      -100 40 0
+-expect      -100.0004058367   40.0000058947        0.0000
++accept      23.7275 37.9838 0
++expect      23.729194873180   37.986398897578   31.289740102
+ -------------------------------------------------------------------------------
+ 
+ 


=====================================
debian/patches/0001-Fix-wrong-behaviour-of-torad_coord-with-gcc-8.1-O2-f.patch
=====================================
--- /dev/null
+++ b/debian/patches/0001-Fix-wrong-behaviour-of-torad_coord-with-gcc-8.1-O2-f.patch
@@ -0,0 +1,59 @@
+Description: Fix wrong behaviour of torad_coord() with gcc 8.1 -O2 (fixes #1084
+ torad_coord() of gie.c has this sequence:
+ ```
+ if( cond )
+     axis = l->param + strlen ("axis=");
+ n = strlen (axis);
+ ```
+ .
+ When the if branch is evaluated, n is always zero
+ even if on inspection axis is non empty
+ .
+ The reason is that the struct ARG_list which is the
+ type of l use a variable-length array for the param member
+ .
+ struct ARG_list {
+     paralist *next;
+     char used;
+     char param[1];
+ };
+ .
+ But this is not a proper way of declaring it, and
+ gcc 8 has apparently optimizations to detect that l->param + 5
+ points out of the array, hence it optimizes strlen() to 0.
+ .
+ Reported as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914
+ .
+ According to https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html,
+ the proper way of declaring such arrays is to use [0]
+Author: Even Rouault <even.rouault at spatialys.com>
+Origin: https://github.com/OSGeo/proj.4/commit/143b4d3f64e0828a3b03dd9ed997dd5412c2b25a
+Bug: https://github.com/OSGeo/proj.4/issues/1084
+
+--- a/src/pj_param.c
++++ b/src/pj_param.c
+@@ -42,7 +42,7 @@ paralist *pj_mkparam_ws (char *str) {
+     }
+ 
+     /* Use calloc to automagically 0-terminate the copy */
+-    newitem = (paralist *) pj_calloc (1, sizeof(paralist) + len);
++    newitem = (paralist *) pj_calloc (1, sizeof(paralist) + len + 1);
+     if (0==newitem)
+         return 0;
+     memmove(newitem->param, str, len);
+--- a/src/projects.h
++++ b/src/projects.h
+@@ -458,7 +458,12 @@ struct PJconsts {
+ struct ARG_list {
+     paralist *next;
+     char used;
+-    char param[1];
++#ifdef __GNUC__
++    char param[0]; /* variable-length member */
++    /* Safer to use [0] for gcc. See https://github.com/OSGeo/proj.4/pull/1087 */
++#else
++    char param[1]; /* variable-length member */
++#endif
+ };
+ 
+ 


=====================================
debian/patches/0001-projects.h-use-param-variable-length-member-syntax-w.patch
=====================================
--- /dev/null
+++ b/debian/patches/0001-projects.h-use-param-variable-length-member-syntax-w.patch
@@ -0,0 +1,22 @@
+Description: projects.h: use param[] variable-length member syntax with GCC >= 8
+ to fix optimization issue with gcc 8.2 (fixes #1084)
+Author: Even Rouault <even.rouault at spatialys.com>
+Origin: https://github.com/OSGeo/proj.4/commit/edfa2981326ea4a476d420436323d0fb37a4efab
+Bug: https://github.com/OSGeo/proj.4/issues/1084
+
+--- a/src/projects.h
++++ b/src/projects.h
+@@ -458,9 +458,10 @@ struct PJconsts {
+ struct ARG_list {
+     paralist *next;
+     char used;
+-#ifdef __GNUC__
+-    char param[0]; /* variable-length member */
+-    /* Safer to use [0] for gcc. See https://github.com/OSGeo/proj.4/pull/1087 */
++#if defined(__GNUC__) && __GNUC__ >= 8
++    char param[]; /* variable-length member */
++    /* Safer to use [] for gcc 8. See https://github.com/OSGeo/proj.4/pull/1087 */
++    /* and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 */
+ #else
+     char param[1]; /* variable-length member */
+ #endif


=====================================
debian/patches/series
=====================================
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+0001-Fix-wrong-behaviour-of-torad_coord-with-gcc-8.1-O2-f.patch
+0001-projects.h-use-param-variable-length-member-syntax-w.patch
+0001-4D-API_cs2cs-style.gie-rewrite-test-to-not-rely-on-p.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/proj/compare/327ae19278c33469825c3a50ba91ee4f9f2687af...e7cf96432104fa2c5f0fef9d32701d19028c6087

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/proj/compare/327ae19278c33469825c3a50ba91ee4f9f2687af...e7cf96432104fa2c5f0fef9d32701d19028c6087
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20180811/e735c621/attachment-0001.html>


More information about the Pkg-grass-devel mailing list