Skip to content

Conversation

csfore
Copy link
Contributor

@csfore csfore commented Jan 25, 2024

Starting in GCC 14, it will begin enforcing C99 so errors regarding incompatible pointer types and so on will be more common. There are currently three C99 build errors that occur:

1:

test/odbctap.h:107:18: error: implicit declaration of function `wcslen' [-Wimplicit-function-declaration]
  107 |   for (i= 0; i < wcslen(wstr); ++i)

2:

test/odbctap.h:601:20: error: initialization of `SQLWCHAR *' {aka `short unsigned int *'} from incompatible pointer type

`wchar_t *' {aka `int *'} [-Wincompatible-pointer-types]
  601 |   SQLWCHAR *val_a= (a), *val_b= (b);

3:

error: passing argument 6 of `SQLGetData' from incompatible pointer type [-Wincompatible-pointer-types]
 1172 |   ok_stmt(hstmt, SQLGetData(hstmt, 0, SQL_C_BOOKMARK, abookmark, 255, &outlen));

The first is fixed by importing <wchar.h>, the second by changing SQLWCHAR to wchar_t, and the third by setting outlen's type to the SQLLEN type.

Starting in GCC 14, it will begin enforcing C99 so errors regarding
incompatible pointer types and so on will be more common. There are
currently three C99 build errors that occur:

1:
test/odbctap.h:107:18: error: implicit declaration of function `wcslen'
[-Wimplicit-function-declaration]
  107 |   for (i= 0; i < wcslen(wstr); ++i)

2:
test/odbctap.h:601:20: error: initialization of `SQLWCHAR *'
{aka `short unsigned int *'} from incompatible pointer type

`wchar_t *' {aka `int *'} [-Wincompatible-pointer-types]
  601 |   SQLWCHAR *val_a= (a), *val_b= (b);

3:
error: passing argument 6 of `SQLGetData' from incompatible pointer
type [-Wincompatible-pointer-types]
 1172 |   ok_stmt(hstmt, SQLGetData(hstmt, 0, SQL_C_BOOKMARK, abookmark, 255, &outlen));

The first is fixed by importing <wchar.h>, the second by changing
SQLWCHAR to wchar_t, and the third by setting outlen's type to the
SQLLEN type.
@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment:
"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."
Thanks

@csfore
Copy link
Contributor Author

csfore commented Jan 25, 2024

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=113766 for updates.
Thanks

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.

2 participants