Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grass_dbmidriver: Fix pointer-sign compiler warnings for ODBC driver #2086

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

nilason
Copy link
Contributor

@nilason nilason commented Jan 12, 2022

Just happened to see a bunch of -Wpointer-sign compiler warnings on the CI Travis Clang build log.
I guess nothing critical, but good to fix.

@nilason nilason added backport_needed bug Something isn't working C Related code is in C labels Jan 12, 2022
@nilason nilason added this to the 8.0.1 milestone Jan 12, 2022
@wenzeslaus
Copy link
Member

Just happened to see a bunch of...

BTW, do you have access to Security > Code scanning alerts?

...on the CI Travis Clang build log.

Also, feel free to enable more checks in the gcc.yml workflow or add a Clang one (marking enabled warnings as error to prevent introduction of new ones).

@nilason
Copy link
Contributor Author

nilason commented Jan 12, 2022

Just happened to see a bunch of...

BTW, do you have access to Security > Code scanning alerts?

Yes, there’s some work waiting there… :)

...on the CI Travis Clang build log.

Also, feel free to enable more checks in the gcc.yml workflow or add a Clang one (marking enabled warnings as error to prevent introduction of new ones).

It’s on my todo list. 👍

@nilason nilason changed the title odbc driver: fix pointer-sign compiler warrnings odbc driver: fix pointer-sign compiler warnings Jan 13, 2022
@nilason
Copy link
Contributor Author

nilason commented Jan 13, 2022

So, with latest push: no more compiler warnings on Travis!
Please review.

Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

+1 Thank you.

Many these are clear, just the right type is needed. The SQLCHAR signed/unsigned char issues seems to be solved by casts to whatever is needed in other projects, too (PHP, unixODBC), although some discussion in Postgres seems to argue for more caution, but for ODBC it says:

We're bound to need some casts, because the ODBC API tends to use
unsigned char pointers while all the libc string functions use signed.

php/php-src@aa58db7
lurcher/unixODBC@78fb6bc
https://postgrespro.com/list/thread-id/1985760

@nilason nilason merged commit 2c937f7 into OSGeo:main Feb 9, 2022
@nilason nilason deleted the fix-Wpointer-sign branch February 14, 2022 08:47
@nilason nilason modified the milestones: 8.0.1, 8.2.0 Feb 14, 2022
@wenzeslaus wenzeslaus changed the title odbc driver: fix pointer-sign compiler warnings grass_dbmidriver: Fix pointer-sign compiler warnings for ODBC driver Apr 27, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C Related code is in C
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants