microsoft / microsoft/sql-server-samples
pls fix check linux to use (CHAR*) cast for calls to CHECK_ERROR
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 11.2k
- Forks
- 9.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 14
Description
99% of people using C/Linux are running GCC.
GCC for a long time thows warnings if you do implicit conversion of string to char*. The preferred method is of course using const char*. There are two options.
1. change the check error strings to be typcasted as shown below
Current Version
CHECK_ERROR(retcode, "SQLAllocHandle(SQL_HANDLE_ENV)",
henv, SQL_HANDLE_ENV);
Type Casted Version
CHECK_ERROR(retcode,(CHAR*)"SQLAllocHandle(SQL_HANDLE_ENV)",
henv, SQL_HANDLE_ENV);
2. Add a statement between where const char gets defined as the string that is going to be passed to check error*
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by locating CHECK_ERROR call sites in the C/Linux samples and inspect the SQLAllocHandle examples for the implicit string-to-CHAR* warnings described here. Done means the affected calls use the selected approach consistently and GCC no longer reports those conversions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux, sql
- Domain
- databases, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100