Skip to content

Comments

lib/shapelib: upgrade from upstream#2694

Merged
nilason merged 5 commits intoOSGeo:mainfrom
nilason:lib_shapedir_upgrade
Jan 8, 2023
Merged

lib/shapelib: upgrade from upstream#2694
nilason merged 5 commits intoOSGeo:mainfrom
nilason:lib_shapedir_upgrade

Conversation

@nilason
Copy link
Contributor

@nilason nilason commented Dec 13, 2022

Upgrade with upstream files from GDAL 3.5.3 and SHAPELIB 1.5.0 .

@nilason
Copy link
Contributor Author

nilason commented Dec 13, 2022

Initially I aimed to fix some compiler warnings (from Ubuntu CI builds):

gcc  -g -O2  -fPIC  -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include    -DPACKAGE=\""grasslibs"\"   -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"lib/external/shapelib\" -o OBJ.x86_64-pc-linux-gnu/dbfopen.o -c dbfopen.c

...

In file included from /usr/include/string.h:495,
                 from dbfopen.c:166:
In function ‘strncpy’,
    inlined from ‘DBFAddNativeFieldType’ at dbfopen.c:908:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dbfopen.c: In function ‘DBFAddNativeFieldType’:
dbfopen.c:907:14: note: length computed here
  907 |     if ((int)strlen(pszFieldName) < 10)
      |              ^~~~~~~~~~~~~~~~~~~~

In file included from /usr/include/string.h:495,
                 from dbfopen.c:166:
In function ‘strncpy’,
    inlined from ‘DBFAlterFieldDefn’ at dbfopen.c:2067:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dbfopen.c: In function ‘DBFAlterFieldDefn’:
dbfopen.c:2066:14: note: length computed here
 2066 |     if ((int)strlen(pszFieldName) < 10)
      |              ^~~~~~~~~~~~~~~~~~~~

Curious whether this was addressed upstreams and if so how, looking at the code I realised it may be worth to update it all. After all it is six years since last upgrade.

@nilason nilason mentioned this pull request Dec 14, 2022
21 tasks
@nilason
Copy link
Contributor Author

nilason commented Dec 15, 2022

@metzm Perhaps you could take a look at this, that I didn’t overlooked something?

@nilason nilason force-pushed the lib_shapedir_upgrade branch from 294baff to bc78e34 Compare December 26, 2022 13:04
******************************************************************************/

#include "shapefil.h"
#include <grass/shapefil.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include "shapefil.h" should be fine because this header is right here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I just mechanically reapplied the old patch in this regard. Now, the patches needed is really at minimum.

Updated accordingly.

@nilason nilason force-pushed the lib_shapedir_upgrade branch from bc78e34 to 08450c5 Compare January 5, 2023 20:04
Copy link
Contributor

@metzm metzm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge!

@nilason nilason merged commit 8e2504c into OSGeo:main Jan 8, 2023
@nilason
Copy link
Contributor Author

nilason commented Jan 8, 2023

Please merge!

Done. Thanks!

@neteler neteler added this to the 8.3.0 milestone Jan 8, 2023
@nilason nilason deleted the lib_shapedir_upgrade branch January 9, 2023 08:34
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
Using GDAL 3.5.3 and SHAPELIB 1.5 and formatted with clang-format.

README file converted to markdown.
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Using GDAL 3.5.3 and SHAPELIB 1.5 and formatted with clang-format.

README file converted to markdown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants