Skip to content

Commit 0a4e255

Browse files
committed
Code and Makefile enhancements to eliminate compilation warnings on some platforms.
1 parent 0305712 commit 0a4e255

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

quickstart/classic/sample_code/common/ttgetopt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ pr_error(char* errmsgbuf, int errmsgbuflen, int do_print,
479479
}
480480
vsnprintf(errmsgbuf + len, errmsgbuflen - len, fmt, ap);
481481
if (do_print) {
482-
fprintf(stderr, errmsgbuf + len); /* ap no longer valid at this point */
482+
fprintf(stderr, "%s", errmsgbuf + len); /* ap no longer valid at this point */
483483
fputs("\n", stderr);
484484
}
485485
}

quickstart/classic/sample_code/common/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ int IsGridEnable(SQLHDBC hdbc)
568568
handle_errors (hdbc, SQL_NULL_HSTMT, rc, ABORT_DISCONNECT_EXIT,
569569
"allocating statement handle", __FILE__, __LINE__);
570570

571-
rc = SQLExecDirect(hstmt, "call ttconfiguration ('TTGridEnable')", SQL_NTS);
571+
rc = SQLExecDirect(hstmt, (SQLCHAR *)"call ttconfiguration ('TTGridEnable')", SQL_NTS);
572572
if (rc != SQL_SUCCESS)
573573
printf("Error call ttconfiguration");
574574

quickstart/classic/sample_code/odbc/bulkinsert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ main(int argc, char **argv)
392392
"turning off auto commit",
393393
__FILE__, __LINE__);
394394

395-
printf("Loading %d records with batch size %lld, commit interval %d\n", records, batchsize, commitsize);
395+
printf("Loading %d records with batch size %lud, commit interval %d\n", records, batchsize, commitsize);
396396

397397
indexTime = 0.0;
398398
if (indexcount && indexbefore) {

quickstart/classic/sample_code/odbc/makefiles/Makefile.macos64.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ wiscextra.o: wiscextra.c
125125
$(CC) $(CFLAGS) -o $@ -c wiscextra.c
126126

127127
wiscbmCS.o: wiscbm.c wiscprotos.h sqlfunc.h
128-
$(CC) $(CFLAGS) $(CSDEFS) -o $@ -c wiscbm.c
128+
$(CC) $(CFLAGS) $(CSDEFS) -Wno-format-security -o $@ -c wiscbm.c
129129

130130
#
131131
# Target for building TimesTen Driver Manager shared library

quickstart/classic/sample_code/odbc/sqlfunc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
#ifndef SQLFUNCH
9-
#define SQLFUN
9+
#define SQLFUNCH
1010

1111
#include "sql.h"
1212
#include "sqlext.h"

quickstart/classic/sample_code/odbc/wiscbm.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,29 +1239,29 @@ static void populateTable (SQLHDBC hdbc,
12391239

12401240
memset (&charVal [0] [charPos], 'x', 52);
12411241
charVal [0] [charPos + 52] = '\0';
1242-
convert (randInt, &charVal [0] [charPos]); /* stringu1: order is random */
1242+
convert (randInt, (char *)&charVal [0] [charPos]); /* stringu1: order is random */
12431243

12441244
memset (&charVal [1] [charPos], 'x', 52);
12451245
charVal [1] [charPos + 52] = '\0';
1246-
convert (tupNum, &charVal [1] [charPos]); /* stringu2: order is sequential */
1246+
convert (tupNum, (char *)&charVal [1] [charPos]); /* stringu2: order is sequential */
12471247

12481248
/* string4: order is cyclic */
12491249
switch (tupNum % 4)
12501250
{
12511251
case 0:
1252-
strcpy (&charVal [2] [charPos], "AAAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
1252+
strcpy ( (char *)&charVal [2] [charPos], "AAAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
12531253
break;
12541254

12551255
case 1:
1256-
strcpy (&charVal [2] [charPos], "HHHHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
1256+
strcpy ( (char *)&charVal [2] [charPos], "HHHHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
12571257
break;
12581258

12591259
case 2:
1260-
strcpy (&charVal [2] [charPos], "OOOOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
1260+
strcpy ( (char *)&charVal [2] [charPos], "OOOOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
12611261
break;
12621262

12631263
case 3:
1264-
strcpy (&charVal [2] [charPos],"VVVVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
1264+
strcpy ( (char *)&charVal [2] [charPos],"VVVVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
12651265
break;
12661266
}
12671267
}
@@ -2879,11 +2879,11 @@ static void BuildDatabase (SQLHDBC hdbc,
28792879

28802880
/* Now create the tables */
28812881
if (grid) {
2882-
sprintf(crTblBuf, crTblStmtsGrid [i]);
2882+
sprintf(crTblBuf, "%s", crTblStmtsGrid [i]);
28832883
} else if (grid_compat) {
2884-
sprintf(crTblBuf, crTblStmtsGridCompat [i]);
2884+
sprintf(crTblBuf, "%s", crTblStmtsGridCompat [i]);
28852885
} else {
2886-
sprintf(crTblBuf, crTblStmts [i]);
2886+
sprintf(crTblBuf, "%s", crTblStmts [i]);
28872887
}
28882888
rc = SQLExecDirect (hstmt, (SQLCHAR*) crTblBuf, SQL_NTS);
28892889
handle_errors (hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT,

0 commit comments

Comments
 (0)