Comments (3)
On openSUSE
unicode.c: In function '_WCHARSIZE':
unicode.c:695:1: warning: control reaches end of non-void function [-Wreturn-type]
695 | }
| ^
unicode.c: In function '_WCHARSIZE_ALLOC':
unicode.c:707:1: warning: control reaches end of non-void function [-Wreturn-type]
707 | }
| ^
unicode.c: In function 'DM_GetWCharAt':
unicode.c:2161:1: warning: control reaches end of non-void function [-Wreturn-type]
2161 | }
| ^
are treated as error, so they breaks building iODBC.
I use this patch to fix the warnings by setting UTF8 as default:
diff -Nur libiodbc-3.52.14/iodbcinst/unicode.c new/iodbcinst/unicode.c
--- libiodbc-3.52.14/iodbcinst/unicode.c 2021-02-17 14:39:22.000000000 +0100
+++ new/iodbcinst/unicode.c 2021-05-31 18:26:17.332781996 +0200
@@ -688,9 +688,10 @@
{
switch(charset)
{
- case CP_UTF8: return 1;
case CP_UTF16: return sizeof(ucs2_t);
case CP_UCS4: return sizeof(ucs4_t);
+ case CP_UTF8:
+ default: return 1;
}
}
@@ -700,9 +701,10 @@
{
switch(charset)
{
- case CP_UTF8: return UTF8_MAX_CHAR_LEN;
case CP_UTF16: return sizeof(ucs2_t) * 2;
case CP_UCS4: return sizeof(ucs4_t);
+ case CP_UTF8:
+ default: return UTF8_MAX_CHAR_LEN;
}
}
@@ -2131,13 +2133,16 @@
switch(charset)
{
+ case CP_UTF16: return (SQLWCHAR)u2[pos];
+ case CP_UCS4: return (SQLWCHAR)u4[pos];
case CP_UTF8:
- {
+ default:
+ {
int mask, len, i=0;
SQLWCHAR wc = 0;
SQLCHAR *u8str = (SQLCHAR*)str;
while(i < pos)
- {
+ {
UTF8_COMPUTE(*u8str, mask, len);
if (len == -1)
break;
@@ -2155,8 +2160,6 @@
}
return wc;
}
- case CP_UTF16: return (SQLWCHAR)u2[pos];
- case CP_UCS4: return (SQLWCHAR)u4[pos];
}
}
from iodbc.
@pkleef @smalinin @timhaynesopenlink -- Please take a look at this.
from iodbc.
The default charset is UCS4, so the pacth was changed for use CP_UCS4 as default and applied.
from iodbc.
Related Issues (20)
- Completion of error handling
- Remove unnecessary null pointer checks
- iODBC on AIX HOT 1
- Silent truncation of 'long' diagnostic messages in SQLGetDiagRec HOT 2
- Crash in SQLBindParameter when driver manager tracing is enabled & a bind offset is in use
- iODBC loses any diagnostics posted during SQLDriverConnect(W)
- why 'php' is loading libiodbc.so.2 ? HOT 4
- calls to SQLBindParameter causes libiodbc to return `SQL_INVALID_HANDLE` on Big Sur HOT 8
- Unable to connect to SQLite using SQLiteODBC on MacBook Air M1 HOT 24
- Comparison with unixODBC? HOT 1
- Please add cmake based build script HOT 3
- SQLGetData doesn't support SQL_ARD_TYPE HOT 3
- macOS installed headers include non-existing files (e.g. <iODBC/sqltypes.h>) HOT 5
- Ugly symlinks installed by macOS installer (//Library/...)
- iODBC on redhat entreprise 8 HOT 5
- Question: how to connect Debian 12 with iODBC to Azuresql HOT 6
- Deadlock during SQLDriverConnect() HOT 1
- Unable to connect between Office 365 Excel and Mysql database HOT 30
- Buffer that is passed to SQLDrivers did not contain a terminating zero but should according to the ODBC standard
- -- please delete --
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iodbc.