Skip to content

Commit 1319997

Browse files
committed
Fix printf format string warning on MinGW.
Commit 517bf2d changed a printf format string to placate MinGW, which at the time warned about "%lld". Current MinGW is now warning about the replacement "%I64d". Reverting the change clears the warning on the MinGW CI task, and hopefully it will clear it on build farm animal fairywren too. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reported-by: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com> Discussion: https://postgr.es/m/TYAPR01MB5866A71B744BE01B3BF71791F5AEA%40TYAPR01MB5866.jpnprd01.prod.outlook.com
1 parent 792b2c7 commit 1319997

File tree

3 files changed

+293
-303
lines changed

3 files changed

+293
-303
lines changed

src/interfaces/ecpg/test/expected/sql-sqlda.c

Lines changed: 66 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,8 @@ dump_sqlda(sqlda_t *sqlda)
155155
printf("name sqlda descriptor: '%s' value %ld\n", sqlda->sqlvar[i].sqlname.data, *(long int *)sqlda->sqlvar[i].sqldata);
156156
break;
157157
case ECPGt_long_long:
158-
printf(
159-
#ifdef _WIN32
160-
"name sqlda descriptor: '%s' value %I64d\n",
161-
#else
162-
"name sqlda descriptor: '%s' value %lld\n",
163-
#endif
164-
sqlda->sqlvar[i].sqlname.data, *(long long int *)sqlda->sqlvar[i].sqldata);
158+
printf("name sqlda descriptor: '%s' value %lld\n",
159+
sqlda->sqlvar[i].sqlname.data, *(long long int *)sqlda->sqlvar[i].sqldata);
165160
break;
166161
case ECPGt_double:
167162
printf("name sqlda descriptor: '%s' value %f\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata);
@@ -188,19 +183,19 @@ main (void)
188183

189184

190185

191-
#line 71 "sqlda.pgc"
186+
#line 66 "sqlda.pgc"
192187
char * stmt1 = "SELECT * FROM t1" ;
193188

194-
#line 72 "sqlda.pgc"
189+
#line 67 "sqlda.pgc"
195190
char * stmt2 = "SELECT * FROM t1 WHERE id = ?" ;
196191

197-
#line 73 "sqlda.pgc"
192+
#line 68 "sqlda.pgc"
198193
int rec ;
199194

200-
#line 74 "sqlda.pgc"
195+
#line 69 "sqlda.pgc"
201196
int id ;
202197
/* exec sql end declare section */
203-
#line 75 "sqlda.pgc"
198+
#line 70 "sqlda.pgc"
204199

205200

206201
char msg[128];
@@ -209,42 +204,42 @@ main (void)
209204

210205
strcpy(msg, "connect");
211206
{ ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "regress1", 0);
212-
#line 82 "sqlda.pgc"
207+
#line 77 "sqlda.pgc"
213208

214209
if (sqlca.sqlcode < 0) exit (1);}
215-
#line 82 "sqlda.pgc"
210+
#line 77 "sqlda.pgc"
216211

217212

218213
strcpy(msg, "set");
219214
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
220-
#line 85 "sqlda.pgc"
215+
#line 80 "sqlda.pgc"
221216

222217
if (sqlca.sqlcode < 0) exit (1);}
223-
#line 85 "sqlda.pgc"
218+
#line 80 "sqlda.pgc"
224219

225220

226221
strcpy(msg, "create");
227222
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) , big bigint )", ECPGt_EOIT, ECPGt_EORT);
228-
#line 95 "sqlda.pgc"
223+
#line 90 "sqlda.pgc"
229224

230225
if (sqlca.sqlcode < 0) exit (1);}
231-
#line 95 "sqlda.pgc"
226+
#line 90 "sqlda.pgc"
232227

233228

234229
strcpy(msg, "insert");
235230
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' , 1111111111111111111 ) , ( 2 , null , null , null , null , null ) , ( 3 , 'c' , 0.0 , 3 , 'c' , 3333333333333333333 ) , ( 4 , 'd' , 'NaN' , 4 , 'd' , 4444444444444444444 ) , ( 5 , 'e' , 0.001234 , 5 , 'e' , 5555555555555555555 )", ECPGt_EOIT, ECPGt_EORT);
236-
#line 103 "sqlda.pgc"
231+
#line 98 "sqlda.pgc"
237232

238233
if (sqlca.sqlcode < 0) exit (1);}
239-
#line 103 "sqlda.pgc"
234+
#line 98 "sqlda.pgc"
240235

241236

242237
strcpy(msg, "commit");
243238
{ ECPGtrans(__LINE__, NULL, "commit");
244-
#line 106 "sqlda.pgc"
239+
#line 101 "sqlda.pgc"
245240

246241
if (sqlca.sqlcode < 0) exit (1);}
247-
#line 106 "sqlda.pgc"
242+
#line 101 "sqlda.pgc"
248243

249244

250245
/* SQLDA test for getting all records from a table */
@@ -253,29 +248,29 @@ if (sqlca.sqlcode < 0) exit (1);}
253248

254249
strcpy(msg, "prepare");
255250
{ ECPGprepare(__LINE__, NULL, 0, "st_id1", stmt1);
256-
#line 113 "sqlda.pgc"
251+
#line 108 "sqlda.pgc"
257252

258253
if (sqlca.sqlcode < 0) exit (1);}
259-
#line 113 "sqlda.pgc"
254+
#line 108 "sqlda.pgc"
260255

261256

262257
strcpy(msg, "declare");
263258
/* declare mycur1 cursor for $1 */
264-
#line 116 "sqlda.pgc"
259+
#line 111 "sqlda.pgc"
265260

266261

267262
strcpy(msg, "open");
268263
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1",
269264
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
270265
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
271-
#line 119 "sqlda.pgc"
266+
#line 114 "sqlda.pgc"
272267

273268
if (sqlca.sqlcode < 0) exit (1);}
274-
#line 119 "sqlda.pgc"
269+
#line 114 "sqlda.pgc"
275270

276271

277272
/* exec sql whenever not found break ; */
278-
#line 121 "sqlda.pgc"
273+
#line 116 "sqlda.pgc"
279274

280275

281276
rec = 0;
@@ -285,37 +280,37 @@ if (sqlca.sqlcode < 0) exit (1);}
285280
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT,
286281
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
287282
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
288-
#line 127 "sqlda.pgc"
283+
#line 122 "sqlda.pgc"
289284

290285
if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
291-
#line 127 "sqlda.pgc"
286+
#line 122 "sqlda.pgc"
292287

293288
if (sqlca.sqlcode < 0) exit (1);}
294-
#line 127 "sqlda.pgc"
289+
#line 122 "sqlda.pgc"
295290

296291

297292
printf("FETCH RECORD %d\n", ++rec);
298293
dump_sqlda(outp_sqlda);
299294
}
300295

301296
/* exec sql whenever not found continue ; */
302-
#line 133 "sqlda.pgc"
297+
#line 128 "sqlda.pgc"
303298

304299

305300
strcpy(msg, "close");
306301
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT);
307-
#line 136 "sqlda.pgc"
302+
#line 131 "sqlda.pgc"
308303

309304
if (sqlca.sqlcode < 0) exit (1);}
310-
#line 136 "sqlda.pgc"
305+
#line 131 "sqlda.pgc"
311306

312307

313308
strcpy(msg, "deallocate");
314309
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id1");
315-
#line 139 "sqlda.pgc"
310+
#line 134 "sqlda.pgc"
316311

317312
if (sqlca.sqlcode < 0) exit (1);}
318-
#line 139 "sqlda.pgc"
313+
#line 134 "sqlda.pgc"
319314

320315

321316
free(outp_sqlda);
@@ -326,35 +321,35 @@ if (sqlca.sqlcode < 0) exit (1);}
326321

327322
strcpy(msg, "prepare");
328323
{ ECPGprepare(__LINE__, NULL, 0, "st_id2", stmt1);
329-
#line 148 "sqlda.pgc"
324+
#line 143 "sqlda.pgc"
330325

331326
if (sqlca.sqlcode < 0) exit (1);}
332-
#line 148 "sqlda.pgc"
327+
#line 143 "sqlda.pgc"
333328

334329

335330
strcpy(msg, "declare");
336331
/* declare mycur2 cursor for $1 */
337-
#line 151 "sqlda.pgc"
332+
#line 146 "sqlda.pgc"
338333

339334

340335
strcpy(msg, "open");
341336
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1",
342337
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
343338
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
344-
#line 154 "sqlda.pgc"
339+
#line 149 "sqlda.pgc"
345340

346341
if (sqlca.sqlcode < 0) exit (1);}
347-
#line 154 "sqlda.pgc"
342+
#line 149 "sqlda.pgc"
348343

349344

350345
strcpy(msg, "fetch");
351346
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch all from mycur2", ECPGt_EOIT,
352347
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
353348
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
354-
#line 157 "sqlda.pgc"
349+
#line 152 "sqlda.pgc"
355350

356351
if (sqlca.sqlcode < 0) exit (1);}
357-
#line 157 "sqlda.pgc"
352+
#line 152 "sqlda.pgc"
358353

359354

360355
outp_sqlda1 = outp_sqlda;
@@ -372,18 +367,18 @@ if (sqlca.sqlcode < 0) exit (1);}
372367

373368
strcpy(msg, "close");
374369
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT);
375-
#line 173 "sqlda.pgc"
370+
#line 168 "sqlda.pgc"
376371

377372
if (sqlca.sqlcode < 0) exit (1);}
378-
#line 173 "sqlda.pgc"
373+
#line 168 "sqlda.pgc"
379374

380375

381376
strcpy(msg, "deallocate");
382377
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id2");
383-
#line 176 "sqlda.pgc"
378+
#line 171 "sqlda.pgc"
384379

385380
if (sqlca.sqlcode < 0) exit (1);}
386-
#line 176 "sqlda.pgc"
381+
#line 171 "sqlda.pgc"
387382

388383

389384
/* SQLDA test for getting one record using an input descriptor */
@@ -407,10 +402,10 @@ if (sqlca.sqlcode < 0) exit (1);}
407402

408403
strcpy(msg, "prepare");
409404
{ ECPGprepare(__LINE__, NULL, 0, "st_id3", stmt2);
410-
#line 198 "sqlda.pgc"
405+
#line 193 "sqlda.pgc"
411406

412407
if (sqlca.sqlcode < 0) exit (1);}
413-
#line 198 "sqlda.pgc"
408+
#line 193 "sqlda.pgc"
414409

415410

416411
strcpy(msg, "execute");
@@ -419,20 +414,20 @@ if (sqlca.sqlcode < 0) exit (1);}
419414
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
420415
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
421416
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
422-
#line 201 "sqlda.pgc"
417+
#line 196 "sqlda.pgc"
423418

424419
if (sqlca.sqlcode < 0) exit (1);}
425-
#line 201 "sqlda.pgc"
420+
#line 196 "sqlda.pgc"
426421

427422

428423
dump_sqlda(outp_sqlda);
429424

430425
strcpy(msg, "deallocate");
431426
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id3");
432-
#line 206 "sqlda.pgc"
427+
#line 201 "sqlda.pgc"
433428

434429
if (sqlca.sqlcode < 0) exit (1);}
435-
#line 206 "sqlda.pgc"
430+
#line 201 "sqlda.pgc"
436431

437432

438433
free(inp_sqlda);
@@ -443,10 +438,10 @@ if (sqlca.sqlcode < 0) exit (1);}
443438
*/
444439

445440
{ ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "con2", 0);
446-
#line 215 "sqlda.pgc"
441+
#line 210 "sqlda.pgc"
447442

448443
if (sqlca.sqlcode < 0) exit (1);}
449-
#line 215 "sqlda.pgc"
444+
#line 210 "sqlda.pgc"
450445

451446

452447
/*
@@ -468,10 +463,10 @@ if (sqlca.sqlcode < 0) exit (1);}
468463

469464
strcpy(msg, "prepare");
470465
{ ECPGprepare(__LINE__, "con2", 0, "st_id4", stmt2);
471-
#line 235 "sqlda.pgc"
466+
#line 230 "sqlda.pgc"
472467

473468
if (sqlca.sqlcode < 0) exit (1);}
474-
#line 235 "sqlda.pgc"
469+
#line 230 "sqlda.pgc"
475470

476471

477472
strcpy(msg, "execute");
@@ -480,65 +475,65 @@ if (sqlca.sqlcode < 0) exit (1);}
480475
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
481476
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
482477
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
483-
#line 238 "sqlda.pgc"
478+
#line 233 "sqlda.pgc"
484479

485480
if (sqlca.sqlcode < 0) exit (1);}
486-
#line 238 "sqlda.pgc"
481+
#line 233 "sqlda.pgc"
487482

488483

489484
dump_sqlda(outp_sqlda);
490485

491486
strcpy(msg, "commit");
492487
{ ECPGtrans(__LINE__, "con2", "commit");
493-
#line 243 "sqlda.pgc"
488+
#line 238 "sqlda.pgc"
494489

495490
if (sqlca.sqlcode < 0) exit (1);}
496-
#line 243 "sqlda.pgc"
491+
#line 238 "sqlda.pgc"
497492

498493

499494
strcpy(msg, "deallocate");
500495
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id4");
501-
#line 246 "sqlda.pgc"
496+
#line 241 "sqlda.pgc"
502497

503498
if (sqlca.sqlcode < 0) exit (1);}
504-
#line 246 "sqlda.pgc"
499+
#line 241 "sqlda.pgc"
505500

506501

507502
free(inp_sqlda);
508503
free(outp_sqlda);
509504

510505
strcpy(msg, "disconnect");
511506
{ ECPGdisconnect(__LINE__, "con2");
512-
#line 252 "sqlda.pgc"
507+
#line 247 "sqlda.pgc"
513508

514509
if (sqlca.sqlcode < 0) exit (1);}
515-
#line 252 "sqlda.pgc"
510+
#line 247 "sqlda.pgc"
516511

517512

518513
/* End test */
519514

520515
strcpy(msg, "drop");
521516
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table t1", ECPGt_EOIT, ECPGt_EORT);
522-
#line 257 "sqlda.pgc"
517+
#line 252 "sqlda.pgc"
523518

524519
if (sqlca.sqlcode < 0) exit (1);}
525-
#line 257 "sqlda.pgc"
520+
#line 252 "sqlda.pgc"
526521

527522

528523
strcpy(msg, "commit");
529524
{ ECPGtrans(__LINE__, NULL, "commit");
530-
#line 260 "sqlda.pgc"
525+
#line 255 "sqlda.pgc"
531526

532527
if (sqlca.sqlcode < 0) exit (1);}
533-
#line 260 "sqlda.pgc"
528+
#line 255 "sqlda.pgc"
534529

535530

536531
strcpy(msg, "disconnect");
537532
{ ECPGdisconnect(__LINE__, "CURRENT");
538-
#line 263 "sqlda.pgc"
533+
#line 258 "sqlda.pgc"
539534

540535
if (sqlca.sqlcode < 0) exit (1);}
541-
#line 263 "sqlda.pgc"
536+
#line 258 "sqlda.pgc"
542537

543538

544539
return 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy